This question already has an answer here:

What do the following numbers represent?

marked as duplicate by kos, muru, Eric Carvalho, Ravan, David Foerster Dec 19 '15 at 10:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Let’s take this one to analyse:

-rwxrw-r-- 1 root    root       4096 Dec 18 16:41 somefile.txt

We will split the output for better understanding.

Field1  Field2  Field3  Field4  Field5  Field6  Field7  Field8  Field9        Field10

-       rwx     rw-     r--     1       root    root    4096    Dec 18 16:41  somefile.txt
  • First field:

    • - for regular file, d for Directory, l for symlink
  • Second: The owner can read, write and execute this file

  • Third: The owner's group can read and write this file

  • Fourth: Other users can read, but not write or execute this file.

  • Fifth: The number of hard links to this file or directories inside this directory.

  • Sixth: The object's owner

  • Seventh: The object's owner's group. All of the users in this group (for example, root, user, www-data, etc.) are affected by the permissions in field 3.

  • Eighth field is the object's size in bytes. Note: ls -lh will use k, M, G, T etc. for human readable. (See man ls or run ls --help.)

  • Ninth field: The object's last modified time; for directories this is not inheritive.

  • Tenth field: The object's name as stored in the filesystem's table of contents

See understanding the Unix permission model, man chmod and apropos permissions for more information.

Note: Some versions of ls(1) also display the octal permissions, which are a simple way of using a number to display and store the first through fourth fields.

  • 3
    The first field could also be b for a block device special file, c for a character device special file, s for a socket, or p for a fifo special file (aka named pipe). You are also missing a field in between the fourth and fifth, where a single character may be appended to the permissions string, indicating Extended Attributes (@) or Extended Security Information such as Access Control Lists (+). The third character in field 2/3 can also be s or S, the third character in field 4 can also be t or T. – Jörg W Mittag Dec 18 '15 at 17:53
  • @JörgWMittag right you are. you can edit that in, if you like – cat Dec 18 '15 at 18:44
  • 3
    field5 = the number of hard links to this file. symlinks to a file don't add 1 to this file's 5th field. Try : touch foo bar and then ls -l foo bar (both will have 1 inode pointing them). then ln foo baz ; ls -l foo bar baz will show both foo and baz, 2 entries pointing to the same inode (pointing to the content of foo), both have "2" as their hard link number. Then add a symlink: ln -s foo toto and still only foo & baz have 2 inodes pointing the same file, toto has 1. In the end, foo & baz will have 2, and bar & toto will have 1 in their 5th field, as both have no hardlinks to them – Olivier Dulac Dec 18 '15 at 19:13
  • Script to calculate permissions: – Helio Dec 18 '15 at 19:58

The numbers represents:

1 is the number of hard links

7160 the file size in bytes.

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