1828036 Members
2052 Online
109973 Solutions
New Discussion

ll output

 
Khashru
Valued Contributor

ll output

What does the second column means in ll out put. the 1 and 2

hpprod:/home/mayub/script :ll -lrt
total 166
-rwxr-x--- 1 mayub faidev 239 Feb 1 10:45 ftp_bdf.sh
-rwxr-x--- 1 mayub faidev 115 Feb 3 13:13 printer_check.sh.back
-rwxr-x--- 1 mayub faidev 184 Feb 3 13:29 printer_check.sh
-rwxr-x--- 1 mayub faidev 344 Feb 3 14:11 printer_name.txt
-rwxr-x--- 1 mayub faidev 146 Feb 15 11:30 mail_bdf_report.sh
-rwxr-x--- 1 mayub faidev 113 Feb 15 11:30 mail_printer_status.sh
-rwxr-x--- 1 mayub faidev 797 Feb 15 12:38 bdf_report.sh
-rwxr----- 1 mayub faidev 372 Feb 16 14:39 information.p
-rwxr-x--- 1 mayub faidev 692 Feb 16 17:09 information
-rw-rw-rw- 1 mayub faidev 66505 Feb 17 14:27 check.txt
drwxr-xrw- 2 mayub faidev 1024 Feb 20 14:03 test
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: ll output

Sivakumar TS
Honored Contributor

Re: ll output


Hi,

It is the amount of links or directories within the directory. The default amount of directories is going to always be 2 because of the . and .. directories.


REgards,

Siva.
Nothing is Impossible !
Yogeeraj_1
Honored Contributor

Re: ll output

hi,

this is the number of the Hard links to the file.

see: http://ei.cs.vt.edu/~netinfo/unixintro/unix.html

In case of a directory it is always a minimum of 2. The number of subdirectories adds up to this figure.

Eg. Files will lots of links:
# ll /sbin/vg*
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgcfgbackup
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgcfgrestore
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgchange
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgchgid
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgcreate
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgdisplay
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgexport
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgextend
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgimport
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgreduce
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgremove
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgscan
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgsync


here 31 meaning we have 31 hard links to the files.

Note that soft links are not considered when calculating this figure.

e.g.
# ln -s /sbin/vgsync /tmp/a
# ll /sbin/vgsync
-r-sr-xr-x 31 root sys 851968 Feb 1 2005 /sbin/vgsync


hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Muthukumar_5
Honored Contributor

Re: ll output

2nd field is referring to number of files or number of links too.

Number of links:

If we create a file with soft or hard link then second field will be changed to 2 for the files. And put as same to the directory.

Number of files or elements:

If a directory is having only 2 files then it is having 4 as link count of,

.
..
2 files.

It is incremented based on files or directories or special files availablity in a directory.

--
Muthu
Easy to suggest when don't know about the problem!