Notes

An ordinary file is a directory entry whose directory, system hidden, and volid attribute (mode) bits are all zero.

Filenames are listed on standard output. Filespecs that don't match any files are listed on standard error.

A file specification consists of an optional drive, optional path information, and a filename. The filename may consist of Bourne shell pattern-matching characters. DOS's filename pattern matching is simplistic, Win32's and OS/2's is a lot better, but Bourne shell pattern matching is better still. Also, all versions (DOS, Win32, and OS2) of the commands in this package support the same enhanced level of pattern-matching.

A dot within a filename is treated as just another character and not assumed to be the beginning of a file extension. Indeed, the ls command has no concept of a file extension. This is compatible with the use of dots within Win32, NTFS, HPFS, and AIX filenames.

Flag characters are case sensitive. Name comparisons are case-insensitive, as specified by DOS, Win32, and OS/2.

If the -l (long format) flag is listed, each file's modification time and date are displayed. Specify the -c flag along with -l to display each file's time of creation. Or, specify the -u flag along with -l to display each file's time of last access. Note that the c and u flags don't yield valid times for a file system (such as DOS or OS/2 FAT) that don't maintain them. Also note that the DOS version simply shows the time of last modification for the -lu and -lc flags.

You may specify more than one set of flags. For example, you may enter the commands ls -n -l *.c *.h and ls -nl *.c *.h both list all .c and .h files in long format, sorted by name.

The order in which you specify certain flags is important. For example, if you specify -l, -C, and/or -1, the last one entered takes precedence. Likewise, if you specify -o, -n, -z, and/or -t, the last one entered overrides the others.

If the ls command is displaying filenames in multicolumn format and/or sorting the names, then ls first stores all of the filenames in memory, sorts them (n, t, or z flag), and determines how many columns to display. The DOS version of the ls command may run out of memory for large file listings. If it does, you should re-run ls with the -1o (number 1 and letter o) flags: force single-column output and don't sort.

The DOS version of ls defaults to showing all filenames in lowercase since this is more readable (especially on smaller displays). The OS/2 version shows HPFS, NFS, and TVFS filenames as-is and shows all other filenames (including those on FAT filesystems) in lowercase. The Win32 version shows all filenames as-is. If you want uppercase filenames, then specify the -U flag. On OS/2 and Win32 platforms, the -L flag will force all names to be shown in lowercase.

The Watcom-built versions (Win32, OS/2, and DOS) do not list the volume label.

Enter ls -? to get help.