Skip to main content
Kill -9 Club
Sign in

ls

FilesPackage: coreutils

Lists a directory's contents. ls -l shows the nine permission characters, the owner and the group — the three things to read before concluding a refused access is a bug.

What its options do in the lessons

From the same glossary the lessons render under their commands, so the two cannot disagree.

ls -h
Prints sizes in human units — 4.2M rather than 4404019. No effect on its own: it complements a long listing such as -l.
ls -l
Long format: permissions, owner, size, date.
ls -a
Includes entries beginning with a dot, hidden by default.
ls -d
Shows the directory itself rather than its contents — the only way to see the permissions of the directory.
ls -n
Like -l, but with numeric UIDs and GIDs. Useful when a user name no longer exists.

Lessons that teach it