ls

Linux · Directories · available in the simulator

What it does

List directory contents.

Syntax

ls [opciones] [archivo...]

Options and parameters

  • -l

    Use a long listing format: permissions, owner, size, and date.

    ls -l
  • -a

    Show hidden files starting with a dot.

    ls -a
  • -R

    List subdirectories recursively.

  • -h

    Print human-readable sizes (K, M, G); used with -l.

    ls -lh
  • -t

    Sort by modification time, newest first.

    ls -lt
  • -S

    Sort by file size, largest first.

  • -A

    Like -a, but do not list implied . and ..

  • -r

    Reverse order while sorting.

  • -1

    List one file per line.

  • -d

    List directories themselves, not their contents.

    ls -ld /etc
  • -F

    Append indicator to names: / directory, * executable, @ link.

  • -i

    Print the index number (inode) of each file.

  • --color

    Colorize the output: auto, always, or never.

    ls --color=auto

Usage examples

  • ls /home/admin
  • ls /etc/network -l
  • ls ~ -a
  • ls / -R
  • ls /home/admin -la
  • ls -lah
  • ls -la /etc
  • ls -a
  • ls -l
  • ls -lh
  • ls -lt
  • ls -ld /etc
  • ls --color=auto
Practise ls

Related commands