ls is a command available in Linux that lists files and directories in the current working directory.

Common flags

FlagDescription
-aShow hidden files (those starting with .)
-lDisplay files in long list format (permissions, owner, size, modification time)
-hPrint file sizes in human-readable format (e.g., 1K, 234M, 2G) — typically used with -l
-RRecursively list subdirectories
-tSort by modification time (newest first)
-SSort by file size (largest first)

Examples

ls -alh

Lists all files (including hidden) in a human-readable long format.

ls -lS /var/log

Lists files in /var/log sorted by size, largest first.