ls

List files and folders

What it does

ls lists what is in a folder: the current one with no arguments, otherwise the one you name. -l gives a detailed list with permissions, owner, size and modification date, and -a adds hidden files, whose names start with a dot, such as .git and .env.

-h together with -l shows sizes in readable units, 4.0K or 12M instead of a byte count. Flags can be combined: ls -la is the same as ls -l -a.

Syntax

ls
ls <folder>
ls -la
ls -lh <folder>

Examples

Related commands

Practise · All commands