LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-28-2010, 07:02 AM   #1
siva balan
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Rep: Reputation: 0
root directory


hello.
i am using fedora 13. when i list the root directory with the command

'ls -la'

i see the parent directory symbol as '..'

So, which is the parent directory for root diectory?
 
Old 07-28-2010, 07:12 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
There isn't a parent directory for /. "cd .." does nothing from /. Why there's a .. entry in /, I don't know, however.
 
Old 07-28-2010, 08:18 AM   #3
redgoblin
Member
 
Registered: Jun 2005
Location: UK
Distribution: Debian
Posts: 189

Rep: Reputation: 41
All directories are required to have a link to their parent and themselves. The root directory is a special case as it is it's own parent. You can see this by adding -i to the ls command;

Code:
cd /
ls -ali
The -i option shows the inode number which is unique for each file and directory on a partition. Your output might be something like;

Code:
total 112
      2 drwxr-xr-x  22 root root  4096 Jun 12 12:41 .
      2 drwxr-xr-x  22 root root  4096 Jun 12 12:41 ..
 407201 drwxr-xr-x   2 root root  4096 Jul 27 09:36 bin
 879553 drwxr-xr-x   3 root root  4096 Jul  9 12:38 boot
     12 lrwxrwxrwx   1 root root    11 Apr 24 09:39 cdrom -> media/cdrom
      4 drwxr-xr-x  18 root root  3360 Jul 19 09:56 dev
 749249 drwxr-xr-x 110 root root 12288 Jul 28 09:51 etc
Note that . and .. have the same inode number. So doing cd .. has the same effect as cd . you change to the directory you're already in.

Last edited by redgoblin; 07-28-2010 at 08:20 AM. Reason: Removed the phrase "hard link" to avoid confusion.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleted /root directory pix9 Linux - General 4 03-02-2010 12:23 AM
restoring desktop directory in /root (or any home directory) mel_lai Linux - Newbie 3 02-04-2008 04:13 AM
Root Directory fosiul Linux - Server 5 06-20-2007 03:41 AM
Partition - root directory? mrobi Linux - Newbie 10 01-11-2003 06:18 PM
looking up my root directory isaacais Linux - Newbie 3 12-19-2002 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration