Fedora Linux Support Community & Resources Center
  #1  
Old 21st October 2009, 02:52 PM
pushparaj_bits Offline
Registered User
 
Join Date: Oct 2009
Posts: 38
windows_xp_2003firefox
why two hard links are created when a directory is created??

helloo,

when I create a directory say mkdir newdir
and so stat newdir I get
stat newdir
File: `newdir'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 1dh/29d Inode: 19122900 Links: 2
Access: (0755/drwxr-xr-x) Uid: (52457/pushpara) Gid: ( 100/ users)
Access: 2009-10-21 13:44:25.062885000 +0000
Modify: 2009-10-21 13:44:25.062885000 +0000
Change: 2009-10-21 13:44:25.062885000 +0000

can any body explani why two hard links are created and what those are??
Reply With Quote
  #2  
Old 21st October 2009, 03:21 PM
William Haller Offline
Registered User
 
Join Date: Jul 2005
Age: 53
Posts: 1,079
linuxfedorakonqueror
One link is . which is the name of the current working directory.
One link is .. which is the name of the parent directory.

It's what lets you do ls -la ../someplace or ls -la ./thisplace and make it work without encoding the . and .. as special items in all the commands. Another way to think of it is the linkages from the root / of the tree down to where you are at.
Reply With Quote
  #3  
Old 22nd October 2009, 07:59 AM
pushparaj_bits Offline
Registered User
 
Join Date: Oct 2009
Posts: 38
windows_xp_2003firefox
Hii william haller,

Thank you for your reply. What I understood is Hard links means number of different name pointing to the same physical file(block). So when we create a new directory with name newdir there are two different names pointing to the same newdir directory file. one is /root/.../newdir and other is . in the newdir . Also when we create a new directory say x in a directory y then the number of hard links to the directory y increses by 1.,because when we create new directory as you said .. will be created, which is pointing to the parent directory.

I am also getting an inference that there is limit to tht number of sub directories we can create in directory. Because the hardlink counter for the parent directory may be of 16 buts or 32 bits or 64 bits.
Reply With Quote
  #4  
Old 23rd October 2009, 04:45 AM
William Haller Offline
Registered User
 
Join Date: Jul 2005
Age: 53
Posts: 1,079
linuxfedorakonqueror
There is a limit on the number of files or directories each directory can contain. This depends on the file system type. I suggest searching comparison of file systems in wikipedia and clicking on each possible file system type. This will have good information about limits of all sorts w.r.t. file systems.
Reply With Quote
Reply

Tags
created, directory, hard, links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I know when a directory or a file was created? youhaodeyi Using Fedora 1 4th August 2009 10:17 AM
Firefox closes after I created a pointer in Plugins directory lerlan1 Using Fedora 1 24th August 2007 04:02 AM
Swap being created? steve941 Using Fedora 3 17th July 2005 07:32 PM
Root Created Dir. carlwill Using Fedora 5 11th July 2005 07:44 PM


Current GMT-time: 11:49 (Friday, 01-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat