HxHippy

ls

List directory contents

Overview

The ls command is used to list files and directories. It is one of the most frequently used commands in Linux.

Syntax

ls [OPTION]... [FILE]...

Common Options

-l

Use a long listing format.

-a

Do not ignore entries starting with . (show hidden files).

-h

With -l, print sizes in human readable format (e.g., 1K 234M 2G).

Examples

$ ls

List files in the current directory.

$ ls -l Documents

List files in the Documents directory in long format.

listfilesdirectorycontentsls