ls

List directory contents. Probably the most frequently used command in Unix-like systems.

Synopsis

ls [options] [file|directory]

Core Options

-l

Use a long listing format (shows permissions, owner, size, modification time).

-a

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

-h

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

-t

Sort by modification time, newest first.

-r

Reverse order while sorting.

Usage Examples

Long Listing with Hidden Files

Show detailed info for all files, including hidden ones.

ls -la

Sort by Date

List files sorted by modification date, newest first.

ls -lt

Human Readable Sizes

Show file sizes in KB, MB, GB.

ls -lh

Recursive List

List all subdirectories recursively.

ls -R

Sort by Size

Sort by file size, largest first.

ls -lS
Built for builders.