ls

See what is inside a folder: names, hidden files, sizes and permissions.

>_ Try it: a simulated Linux, right here
Loading the terminal…

Examples

  • ls
  • ls -l
  • ls -la
  • ls -lh
  • ls /etc

How it works

ls lists what is in a folder. With no name it shows the folder you are in (pwd tells you which one).

Add -l for the long listing: permissions, owner, size and date for each file. Names that start with a dot are hidden; -a shows them too.

Syntax

ls [OPTION]... [FOLDER]...

Options

OptionWhat it does
-llong listing: permissions, owner, size, date
-ashow hidden files (names that start with a dot)
-hsizes people can read (4.0K, 1.2M), together with -l
-1one name per line

Good to know

  • Options can be combined: ls -la is ls -l -a.
  • A line starting with d in ls -l is a folder; - is a file.