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
ls -lah /etcLists /etc with hidden files, permissions, owners, and readable sizes.
ls -l ~/.bashrcShows metadata for a specific file instead of the whole directory.
| Field | Details |
|---|---|
| Command | ls |
| Category | Navigation |
| Primary use | Lists files and directories. |
| Syntax | ls [options] [path] |