Frequently Asked Question
What does ls -l actually tell me on each line?
A single long-format line packs a surprising amount of information. The first ten
characters are the file type plus the nine permission bits, type, then owner
rwx, group rwx, other rwx. The next column is the link count: for a regular file
it is the number of hard links to its inode (usually 1); for a directory it is the
number of subdirectories plus two (one for ., one for .. in each child). Then
come the owner and group names, the file size in bytes, and the modification
timestamp.
The final column is the name. For symlinks it is followed by an arrow and the
target. Flags change what you see: -h formats sizes as K/M/G, -t sorts by
mtime, -S by size, -i prepends the inode number, and -F appends an indicator
character (/ for directory, @ for symlink, * for executable). On most
distributions ls is aliased to ls --color=auto so file types are colourised, but
the colours are purely cosmetic and decided by LS_COLORS.