Navigation

ls

Lists files and directories.

ls shows the contents of a directory. It is often the first command used when you need to understand what is nearby in the filesystem.

Syntax
ls [options] [path]

Arguments explained

  • path is the directory or file to list.
  • -l shows a long listing with permissions, owner, size, and date.
  • -a includes hidden dotfiles.
  • -h makes sizes human-readable when used with -l.

Common examples

Show a readable detailed listing
ls -lah /etc

Lists /etc with hidden files, permissions, owners, and readable sizes.

List one file
ls -l ~/.bashrc

Shows metadata for a specific file instead of the whole directory.

ls Command
FieldDetails
Commandls
CategoryNavigation
Primary useLists files and directories.
Syntaxls [options] [path]