ls
List directory contents. Probably the most frequently used command in Unix-like systems.
Synopsis
ls [options] [file|directory]
Core Options
-lUse a long listing format (shows permissions, owner, size, modification time).
-aDo not ignore entries starting with . (shows hidden files).
-hWith -l, print sizes in human readable format (e.g., 1K 234M 2G).
-tSort by modification time, newest first.
-rReverse order while sorting.
Usage Examples
Long Listing with Hidden Files
Show detailed info for all files, including hidden ones.
ls -laSort by Date
List files sorted by modification date, newest first.
ls -ltHuman Readable Sizes
Show file sizes in KB, MB, GB.
ls -lhRecursive List
List all subdirectories recursively.
ls -RSort by Size
Sort by file size, largest first.
ls -lSBuilt for builders.