ls—List Directory

The ls (list directory) command is a loose adaptation of the GNU ls command, and is a better DIR command than DIR. It supports multiple file specifications on the command line. It matches filenames using the Bourne shell pattern matching rules and not the DOS or OS/2 ``wildcard'' rules.

The ls command lists the names of ordinary files, hidden files, system files, and directories as you wish. It also lists each name with any drive and path information that was in the original file specification. It can recursively descend subdirectories looking for matching files and or directories if you wish.

In the ``long'' format, the ls command displays each file's attributes as well as its size, date, and time.

By default, ls sorts the output by filename, and displays the names in multi-column format if standard output is a character device. When writing multi-column output, ls sorts the files by column, newspaper-style, just as the Unix and GNU ls commands do (and unlike the simplistic sort by row performed by the DOS, Win32, and OS/2 DIR commands).



Subsections