LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 02-04-2009, 09:14 AM   #1
s_b
LQ Newbie
 
Registered: Oct 2008
Posts: 17

Rep: Reputation: 0
Link count


Hi

Can someone explain to me what a link count is and how it works?
 
Old 02-04-2009, 09:19 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
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.
 
Old 02-04-2009, 09:23 AM   #3
s_b
LQ Newbie
 
Registered: Oct 2008
Posts: 17

Original Poster
Rep: Reputation: 0
here in my papers it says: for each file and directory there exist a link count.
 
Old 02-04-2009, 10:01 AM   #4
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
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.
 
  


Reply



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
Hard link count is wrong dwarf007 Linux - General 1 09-30-2008 01:34 PM
Open file with a link count of less than 1 ? budword Linux - Security 1 03-23-2007 06:37 AM
Listing Files with Specified Link Count jonwatson Programming 5 01-04-2007 12:01 PM
selinux hard link count blues jmjaffe Fedora 1 06-23-2006 12:33 PM
Link count value? jch02140 Linux - Newbie 1 07-18-2005 11:44 PM

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

All times are GMT -5. The time now is 08:34 PM.

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
Open Source Consulting | Domain Registration