The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
semaphore concept maverix UNIX for Advanced & Expert Users 8 04-10-2008 11:07 AM
LUN concept Prem HP-UX 1 02-22-2007 04:02 PM
Having difficulty with UNIX concept. Please help! ALon UNIX for Dummies Questions & Answers 4 01-11-2007 10:42 AM
IPTABLES Firewall concept help Bradley Porter UNIX for Dummies Questions & Answers 1 01-02-2007 04:39 AM
Linux Man Page Online Link killerserv News, Links, Events and Announcements 0 02-27-2002 09:37 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-11-2008
Registered User
 

Join Date: Dec 2008
Posts: 4
Concept of link count in linux

Hi All,

Please explain me the concept of link counts when you try to view the contents of any file or directory using ls command.

-sh-3.00$ ls -lrt
total 194
drwxr-xr-x 2 root root 4096 Aug 12 2004 srv
drwxr-xr-x 2 root root 4096 Aug 12 2004 mnt
drwxr-xr-x 2 root root 4096 Aug 12 2004 initrd
drwxr-xr-x 2 root root 4096 Aug 12 2004 home
drwxr-xr-x 2 root root 4096 Aug 24 2005 misc
drwx------ 2 root root 16384 Jun 26 2006 lost+found
drwxr-xr-x 2 root root 4096 Jun 26 2006 selinux
drwxr-xr-x 2 root root 4096 Jun 26 2006 post
drwxr-xr-x 4 root root 1024 Jun 26 2006 boot
drwxr-xr-x 28 root root 4096 Nov 2 2006 var
drwxr-xr-x 18 root root 4096 Feb 15 2008 usr
drwxr-xr-x 12 mqm mqm 4096 Sep 26 12:58 mqm
drwxr-xr-x 35 root root 4096 Nov 20 19:42 opt
dr-xr-xr-x 8570 root root 0 Nov 23 13:53 proc
drwxr-xr-x 9 root root 0 Nov 23 13:53 sys
drwxr-xr-x 9 root root 6100 Nov 23 13:57 dev
drwxr-xr-x 4 root root 4096 Nov 23 13:57 media
drwxr-xr-x 2 root root 4096 Dec 7 04:23 bin
drwxr-xr-x 10 root root 4096 Dec 7 04:23 lib
drwxr-xr-x 2 root root 12288 Dec 7 04:23 sbin
drwxr-x--- 3 root root 4096 Dec 10 04:15 root
drwxr-xr-x 61 root root 12288 Dec 11 04:02 etc
drwxrwxrwt 7 root root 4096 Dec 11 12:24 tmp
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-11-2008
Registered User
 

Join Date: Jul 2008
Posts: 70
There are 2 types of links; symbolic links, which refer to a symbolic path indicating the abstract location of another file, and hard links, which refer to the specific location of physical data. A Link count shows how many directory entries link to the file.
A file's link count is displayed in the second column of output from the ls -l . This number represents the total number of links that have been created to point to the data. Each time a new link is created, this value is increased by 1. When a link is removed, the value is decreased by 1. It keeps a count so when you do rm commands against a 'copy' of the file the link count gets decremented, when it reaches 0 the actual file is, finally, deleted.

Any number of hard links to physical data may be created. Links can be created by using the ln command

more info here on link counts-
http://teaching.idallen.com/cst8129/...nd_inodes.html
The Answer Guy 35: Listing "Just the Links": It's the only way, Luke

Last edited by techlinux; 12-11-2008 at 02:03 PM.. Reason: edit url
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 07:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66