root dir ? home dir ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers root dir ? home dir ?
# 1  
Old 02-06-2007
root dir ? home dir ?

I am little bit confused when the words "root directory" and "home directory" and "parent directory" are used. Can anybody explains the difference.

I am trying to list the names and protections levels and size of visible files in the root directory

would it be correct if I just typed:

ls -o ./ ?

I guess "./" pretends that it would be a parent directory ? or using a ~ maybe this is for a home dir...? Confused ! Smilie
# 2  
Old 02-07-2007
The root directory is /
Home directory is assigned to you when your account is added. It might be something like /home/hinman /export/home/hinman or something like that. Each user gets a home directory.

/export/home/hinman has a parent called /export/home
/export/home has a parent called /export
/export has a parent called /
/ does not really have a parent, but it acts as it's own parent.

With many shells you can use ~ as a shortcut for /export/home/hinman but if I use ~ it would be /export/home/perderabo (or whatever our home directories really are). We both can use ~joe to refer to joe's home directory.

Every directory must have two special entries called . and ..
. is the current directory
.. is the parent directory

So if you are in /usr/local/bin, . is /usr/local/bin and .. is /usr/local. Unlike ~ these really are in the directory and will work with any shell.
# 3  
Old 02-07-2007
Quote:
Originally Posted by hinman
I am little bit confused when the words "root directory" and "home directory" and "parent directory" are used. Can anybody explains the difference.

I am trying to list the names and protections levels and size of visible files in the root directory

would it be correct if I just typed:

ls -o ./ ?

I guess "./" pretends that it would be a parent directory ? or using a ~ maybe this is for a home dir...? Confused ! Smilie

You might want to check some things about the UNIX file system: http://www.liquidweb.com/manual/chap...ilesystem.html

Regards,
Johan Louwers
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

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. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies

2. UNIX for Dummies Questions & Answers

Switching from root to normal user takes me to user's home dir

Whenever i switch from root to another user, by doing su - user, it takes me to home directory of user. This is very annoying as i want to be in same dir to run different commands as root sometimes and sometimes as normal user. How to fix this? (1 Reply)
Discussion started by: syncmaster
1 Replies

3. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

4. Shell Programming and Scripting

Home dir renaming

It is required to rename the home dir of some users specifed in the file ids.csv. But the code is not working as expected. ids.csv have content in the format id1,name,id2 It displays the expected message , still it is unable to rename the dirs Find the code below: #!/bin/ksh... (3 Replies)
Discussion started by: hiten.r.chauhan
3 Replies

5. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

6. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

7. UNIX and Linux Applications

CPIO Problem, copy to the root dir / instead of current dir

HI all, I got a CPIO archive that contains a unix filesystem that I try to extract, but it extract to the root dir / unstead of current dir, and happily it detects my file are newer otherwise it would have overwrited my system's file! I tried all these commands cpio -i --make-directories <... (2 Replies)
Discussion started by: nekkro-kvlt
2 Replies

8. Shell Programming and Scripting

home dir checking

Hi, I want suggestion about user home directories, checking. how i could calculate this. I have 200 Users. if home-dir-of-user1 > 250 MB -> print "OK" fi if home-dir-of-user1 > 500 MB > Print "Warning" fi if home-dir-of-user1 > 1000 MB > Print "Critical" fi Thanks, Bash (4 Replies)
Discussion started by: learnbash
4 Replies

9. HP-UX

Home dir for users

Hello all, Most of our users have the same home directory, I know it's weird but it has been like this before me and we don't want to change that for now. When creating a new user using command useradd, it is not allowing me to create it because it is using the home directory of someone else. I... (2 Replies)
Discussion started by: qfwfq
2 Replies

10. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies
Login or Register to Ask a Question