ls [options] [names]If no names are given, list the files in the current directory. With one or more names, list files contained in a directory name or that match a file name. The options let you display a variety of information in different formats. The most useful options include -F, -R, -a, -l, and -s. Some options don't make sense together; e.g., -u and -c.
Note: the Solaris /usr/bin/ls pays attention to the LC_COLLATE environment variable. Its default value, en_US, (in the United States) causes ls to sort in dictionary order (i.e., ignoring case). Set LC_COLLATE to C to restore the traditional Unix behavior of sorting in ASCII order, or use /usr/ucb/ls.
-aList all files, including the normally hidden . files.
-ALike -a, but exclude . and .. (the current and parent directories). Solaris only.
-bShow nonprinting characters in octal.
-cList files by inode modification time.
-CList files in columns (the default format, when displaying to a terminal device).
-dList only the directory's information, not its contents. (Most useful with -l and -i.)
-fInterpret each name as a directory (files are ignored).
-FFlag filenames by appending / to directories, > to doors (Solaris only), * to executable files, | to fifos, @ to symbolic links, and = to sockets.
-gLike -l, but omit owner name (show group).
-iList the inode for each file.
-lLong format listing (includes permissions, owner, size, modification time, etc.).
-LList the file or directory referenced by a symbolic link rather than the link itself.
-mMerge the list into a comma-separated series of names.
-nLike -l, but use user ID and group ID numbers instead of owner and group names.
-oLike -l, but omit group name (show owner).
-pMark directories by appending / to them.
-qShow nonprinting characters as ?.
-rList files in reverse order (by name or by time).
-RRecursively list subdirectories as well as current directory.
-sPrint sizes of the files in blocks.
-tList files according to modification time (newest first).
-uList files according to the file access time.
-xList files in rows going across the screen.
-1Print one entry per line of output.
List all files in the current directory and their sizes; use multiple columns and mark special files:
ls -asCF
List the status of directories /bin and /etc:
ls -ld /bin /etc
List C source files in the current directory, the oldest first:
ls -rt *.c
Count the files in the current directory:
ls | wc -l