Terminal Dojo
Help العربية Sign inGet started

Command library / ls

ls

BashDraft — pending expert review4 practice missions

List directory contents

Lists files and directories. On its own it prints names only; options add permissions, owners, sizes, dates and hidden files. During an investigation it is usually the first command you run to see what is really inside a folder.

Practice ls

Usage

ls [options] [path...]

Options and flags

Examples

Common mistakes

ls -r /etc/ssh ls -R /etc/ssh

Lowercase -r reverses the sort order; capital -R is the recursive one. Options are case-sensitive.

ls -a -l -h /var ls -lh /var

-a adds hidden files, which this listing does not need; extra options change the output.

Related commands

chmodgrepfindcd