Frequently Asked Question
What do the three rwx triplets in ls -l actually mean?
Every file on a Linux filesystem stores nine permission bits, arranged as three
triplets of read/write/execute for three categories of user: the file's owner,
the file's group, and everyone else (sometimes called "other" or "world").
ls -l displays them as -rwxr-xr--: the leading dash is the file type (- for
regular file, d for directory, l for symlink), then owner permissions, then
group permissions, then others' permissions. A dash in any position means the bit
is off.
For a regular file, r lets you read the contents, w lets you modify them, and
x lets you execute the file as a program. For a directory the meanings shift:
r lets you list filenames, w lets you add, remove or rename entries, and x
lets you actually enter the directory and resolve names inside it. The execute bit
on a directory is the one beginners trip over, without it you cannot cd in or
open any file inside even if you know the exact name.