Entering directories structured above user.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Entering directories structured above user.
# 1  
Old 01-25-2005
Tools Entering directories structured above user.

I wish to enter directories which are on the HD but not part of the user hierarchy and have access to the contents of an external HD. To an advanced user this is probably a stupid question but I experimented with ~, cd, . and.. to no avail. I did check for a suitable command but couldn't find one. How does one cd up the hierarchical chain?
Any help will be appreciated.

Thanks,
Frank
# 2  
Old 01-25-2005
Frank,

Let's say you are in a user directory called
/export/home/frank

To go up one level to /export/home
% cd ..

To go up two levels (to /export) from the frank directory
% cd ../..
# 3  
Old 01-25-2005
Bug

Thanks again RTM, like most things it was pretty obvious in hindsight. I didn't expect the 'upward' levels to be designated as ../../ and was expecting to see the proper name for the levels. Please stick with me, I'm learning and it is easier now that I realise that it is very similar to operating a shell on the Amiga.
# 4  
Old 01-25-2005
Hi again, the greenhorn is back.

The path to account Frank Hunter is:- Frank Hunter's Computer/Main/Users.Frank Hunter.

Thanks to RTM I am able to access Main but cannot move upwards into it's parent, the basic computer.
I need this to enable access to an external HD and the optical drive.

d205-250-231-229:~ frankhunter$ cd ../../ gets me into Main as the working directory but any additional ../ make no difference. Is there a special designation for the basic computer?

Thank you
Frank
# 5  
Old 01-25-2005
Hi Frank,

Which OS (Operating System) are you using here? Please post the output of the "uname -a" command.

Within UNIX, everything "hangs off of" the root directory, which is represented by a single slash, / - this is the "Top" of the directory heirarchy. This is opposed to Windows where each Disk/Partition has it's own "root" directory, C:, D:, etc - with the concept of "My Computer" being a container housing these drives (I'm trying to be as conceptual and less technical as possible here!)

For example, my home directory might be /export/home/zazzybob (or /home/zazzybob), the path to the "foo" command might be /usr/local/bin/foo.

A path such as Frank Hunter's Computer/Main/Users.Frank Hunter doesn't look too UNIX like to me?! If you are in your "home" directory (i.e., you've just logged on, and haven't cd'd anywhere), type "pwd" and let us know what the result is. For example, on one of my systems.
Code:
$ pwd
/some/path/here
$ cd ../../..
$ pwd
/

Here you can see I've moved right up to the top of the directory heirarchy to the "root" directory.

Cheers
ZB
# 6  
Old 01-25-2005
Hi Guys,
I'm running a G5 iMac, vers, 10.3.7.

result of 'uname -a' :-
Darwin d205-250-231-229.bchsia.telus.net 7.7.0 Darwin Kernel Version 7.7.0: Sun Nov 7 16:06:51 PST 2004; root:xnu/xnu-517.9.5.obj~1/RELEASE_PPC Power Macintosh powerpc

My apologies, the path I gave is the OSX path, I didn't know of any other way to explain it.
The result of pwd :-
/Users/frankhunter

Using ../ I can regress to users but not to the Hard drive nor peripherals

Hope this makes sense.

Please excuse this comment, but I like your Avatar! looks like an uncle of mine, complete with ratting cap.

Thanks,
Frank
# 7  
Old 01-26-2005
Dear Frank,

You can go to the root directory of your entire filesystem with this command:

cd /

Then, simply type a command such as

ls -l

and you will see the first level of directories under the root of your filesystem.

Then, simply "cd" into one of the directories you see, for example:

cd /etc

Neo

PS, for example:

Code:
www# cd /
www# ls -l
total 117
drwxr-xr-x    2 root     root         4096 Sep  6  2003 archives/
drwxr-xr-x    2 root     bin          4096 Jan 18  2004 bin/
drwxr-xr-x    5 root     root         1024 Aug 24  2003 boot/
drwxr-xr-x   11 root     root         4096 Aug 25  2003 database/
drwxr-xr-x   14 root     root        45056 Nov 24 21:26 dev/
drwxr-xr-x   37 root     root         4096 Jan 23 22:57 etc/
drwxr-xr-x   14 root     users        4096 Jan 23 22:57 home/
drwxr-xr-x    4 root     root         4096 Jan  1  2003 lib/
drwx------    2 root     root        16384 Jan  1  2003 lost+found/
drwxr-xr-x    5 root     root         4096 Mar 16  2002 mnt/
drwxr-xr-x    4 root     root         4096 May 19  2002 opt/
dr-xr-xr-x   69 root     root            0 Nov 24 16:26 proc/
drwx--x---    9 root     root         4096 Jan 24 18:32 root/
drwxr-xr-x    2 root     bin          4096 Jun  1  2002 sbin/
drwxrwxrwt    4 mysql    users        4096 Jan 25 23:30 tmp/
drwxr-xr-x   21 root     root         4096 Dec  4 18:04 usr/
drwxr-xr-x    4 root     root         4096 Dec 20 00:04 usr2/
drwxr-xr-x   18 root     root         4096 Nov 24 22:56 var/
www# cd etc
www# pwd
/etc
www#

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Giving read write permission to user for specific directories and sub directories.

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies

2. Programming

Reading structured arguments

I am passing an argument to a C++ program which is going to look like I need to get the integers into arrays a, b, c, d with a= 12,12,34,2,12 b= 34,4,2,1,23 c= 5,5,4,4,13 d= 6,6,6,6,5 (5 Replies)
Discussion started by: kristinu
5 Replies

3. Shell Programming and Scripting

Using awk to create a summary of a structured file

I am trying to use awk to create a summary of a structured file. Here is what it looks like: (random text) H1 H2 H3 H4 44 78 99 30 31 -- 32 21 12 33 55 21 I'd like to be able to specify a column, say H2, and then have information about that column printed. ... (4 Replies)
Discussion started by: afulldevnull
4 Replies

4. Solaris

Particular user account shouldn't be locked after entering wrong passwd specfic no. times

Hi all In my system we have implemented user lockout feature after 3 failure attempt if he tries to login directly or if he run the any command through sudo and enter wrong password thrice. Now I have requirement in which particular user account shouldn't be locked when he run the command... (1 Reply)
Discussion started by: sb200
1 Replies

5. Solaris

Login delay after entering id (40 secs) same after entering pw

Hi all, I have just installed Solaris 10 on an old Fujitsu Primepower 650 which has been wiped clean. I haven't installed anything apart from the OS yet, so the machine is 99% idle. I get long delays when logging in, first after entering the id then another long delay after entering a valid... (8 Replies)
Discussion started by: longjon
8 Replies

6. Shell Programming and Scripting

Parsing structured files in Perl

Hi, looking for a piece of code to get the values from a structured text file like this: ############################################################################### ############################################################################### # # PERSONAL DATA DEFINITIONS #... (8 Replies)
Discussion started by: sarabande
8 Replies

7. UNIX for Dummies Questions & Answers

find directories owned by a given user

Hi, I want to know if the is a way I can list the directories owned by a given user. Say i am logged in as that user. I found out the find command lists the files owned by a certain user/group but i want to know only the directories and if possible the permissions associated with these... (6 Replies)
Discussion started by: poojabhat
6 Replies

8. Shell Programming and Scripting

structured file update

Hi I have a very structured file consisting of multiple lines as follows: 3752 AVAILABLE 06/24/2009 FFFF 000000 0000 0000 3753 TRADITION (ASIA) LTD TACB 008329 0000 0000 3754 WACHOVIA CONVS/PRFDS WBCP 001099 0000 0000 3755 AVAILABLE 05/12/2009 FFFF 000000 0000 0000 3756... (3 Replies)
Discussion started by: aoussenko
3 Replies

9. UNIX for Advanced & Expert Users

How to use SFTP from command line without entering user and password

I would like to use SFTP from command line without entering userid and password. Here is what I have gathered and did. 1) Create a public and private key pair for the protocol you want to use. To create a key pair for use by SSH2, enter: ssh-keygen -t dsa I did that and got... (7 Replies)
Discussion started by: Hangman2
7 Replies
Login or Register to Ask a Question