LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Link count (https://www.linuxquestions.org/questions/linux-newbie-8/link-count-702241/)

s_b 02-04-2009 09:14 AM

Link count
 
Hi

Can someone explain to me what a link count is and how it works?

Agrouf 02-04-2009 09:19 AM

Could you describe the context a little more please?

I assume you talk about hard links on the filesystem (the one you see when you type ls -l) for now, but I really don't know.
so, if you are talking about links on the filesystem, a hard link count is the number of links to a file and it is incremented when a link is made and decremented when a link is removed.

s_b 02-04-2009 09:23 AM

here in my papers it says: for each file and directory there exist a link count.

Agrouf 02-04-2009 10:01 AM

Indeed, a file link is a basically a file name. A file can have several names everywhere in the directory tree.
The same goes for directories.
If you create a file and give it 2 names, it has 2 links. When you remove one link, the file is still there. when you remove all links, the file is deleted. The link count is the number of names a file has.
You can create a link with the 'ln' command.


All times are GMT -5. The time now is 10:01 AM.