The Linux command that lists files in a directory is ls.
Used without arguments, ls displays the names of entries in the current working directory. It can also accept a path, such as ls /var/log, to inspect another directory. The command name is commonly understood as an abbreviation of “list,” making it one of the first commands many Linux users learn.
Several options make the output more useful. ls -l shows a long listing with permissions, ownership, file sizes, and modification times. ls -a includes hidden entries whose names begin with a dot, while ls -lh combines long format with human-readable file sizes. Options can be combined, so ls -lah is a popular inspection command.
A common mix-up is pwd, which prints the current directory’s path, and cd, which changes directories. The command dir may also exist on some Unix-like systems, but ls is the standard and canonical Linux command. Shell aliases can change how ls behaves—for example, adding color or a default long format—without changing the underlying command’s purpose.