COMMAND

ls -- list file and directory names, also list file/directory attributes


SYNOPSIS

ls [-aAbcCdfFgilmnopqrRstux1] [pathname ...]


DESCRIPTION

The ls command lists files and directories. If the pathname is a file, ls provides information according to the specified options. If pathname is a directory, ls lists the files and subdirectories contained in the specified directory. Information about the directory itself can be obtained using the -d option.

If no pathname is provided, ls displays the files and directories in the current directory.

The ls command behaves differently depending on whether its output is sent to the screen or to a pipe or file. In the latter case, ls displays only one file per line. In the former case, ls produces several columns, and so more than one file is typically listed per line.

ls file1 file2
cause a copy of file1 to be displayed on the screen followed by file2

If `-' is given as one of the filenames, then ls will read the standard input.


OPTIONS

The ls command provides the following options:
-alist all entries, including names beginning with a period (.)
-Asame as -a only the current directory (".") and parent directory ("..") are not listed
-bdisplay unprintable characters using octal notation
-Coutput using column format (default behavior when ls outputs to screen)
-csort output according to time of last modification of file or directory
-ddisplay information about named directory, rather than directory contents
-Foutput a slash (/) after directory names
-idisplay inode numbers
-Llist symbolic links
-ldisplay long format information (owner, group, size, time filename, links, etc.)
-mdisplay names in a single line, with commas separating names
-nindicate user-ID and group-ID numbers
-odo not display owner
-pappends '/' following directory names
-qdisplay nongraphic characters as `?'
-Rlist subdirectories recursively
-rsort output in reverse order
-sindicate file size in blocks
-tsort output by modification time
-usort by last access time
-xoutput order by row rather than by column
-1display output as a single column
--helpdisplays a help screen summarizing the command syntax
Options are specified in the command line.


PORTABILITY

All UNIX systems supporting the DOS 2.0 and up, with UWIN or MKS Toolkit. Apple OSX.


SEE ALSO

lc (UNIX), file (UNIX), find (UNIX)