Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The ls command lists the contents of a directory.

ls is a command to list files and their metadata (time, size, owner, etc.). Some implementations can show files in color.

ls does not expand wildcards: this is done by the .

It is very nearly always a mistake to use ls in a script. If you're just expanding wildcards, the shell does it already. If you're looking for files based on criteria such as their size or time, use (or 's glob qualifiers if you have zsh).

Further reading

history | excerpt history