Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am wondering what the number 1234 means in this example:

rw-rw-rw- 1234 blabla blabla 3243253235 14:40 myfile.zip
share|improve this question

migrated from serverfault.com Jun 12 '12 at 18:08

This question came from our site for professional system and network administrators.

    
The stat utility usually gives you more convenient access to the information you need in the way you need it. –  0xC0000022L Jun 12 '12 at 18:12

3 Answers 3

up vote 4 down vote accepted

From man ls

If the -l option is given, the following information is displayed for each file: file mode, number of links, owner name, group name, number of bytes in the file, abbreviated month, day-of-month file was last modi- fied, hour file last modified, minute file last modified, and the path- name. In addition, for each directory whose contents are displayed, the total number of 512-byte blocks used by the files in the directory is displayed on a line by itself, immediately before the information for the files in the directory. If the file or directory has extended attributes, the permissions field printed by the -l option is followed by a '@' character. Otherwise, if the file or directory has extended security information (such as an access control list), the permissions field printed by the -l option is followed by a '+' character.

In short, it is the number of links to that file.

share|improve this answer

That means the links to that file or directory's inode. Hard links I mean, not soft links:

[root@biggiesmalls agsantovena]# touch test
[root@biggiesmalls agsantovena]# ls -l
total 0
-rw-r--r-- 1 root root 0 Jun 12 10:50 test
[root@biggiesmalls agsantovena]# ln test test2
[root@biggiesmalls agsantovena]# ls -l
total 0
-rw-r--r-- 2 root root 0 Jun 12 10:50 test
-rw-r--r-- 2 root root 0 Jun 12 10:50 test2
share|improve this answer

The "number of links" to a file or directory is basically the number of names it has (and the names do not have to exist in the same directory, but they do have to exist on the same filesystem — hard links cannot cross filesystem boundaries).

Note that a directory with subdirectories will have a link for each occurrence of the name .. in each subdirectory, since the .. directory is nothing but a hard link to the parent directory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.