NAME ls - list contents of directory SYNOPSIS ls [ -aAbcCdfFgilLmnopqrRstux1 ] [ file... ] DESCRIPTION For each file that is a directory, ls lists the contents of the directory; for each file that is an ordinary file, ls repeats its name and any other information requested. The output is sorted alphabetically by default. When no argu- ment is given, the current directory is listed. When several arguments are given, the arguments are first sorted appropriately, but file arguments appear before directories and their contents. The mode printed under the -l option consists of ten charac- ters. The first character may be one of the following: d the entry is a directory; l the entry is a symbolic link; b the entry is a block special file; c the entry is a character special file; p the entry is a fifo (or "named pipe") special file; - the entry is an ordinary file; | the entry is a FIFO. The next 9 characters are interpreted as three sets of three bits each. The first set refers to the owner's permissions; the next to permissions of others in the user-group of the file; and the last to all others. Within each set, the three characters indicate permission to read, to write, and to execute the file as a program, respectively. For a directory, ``execute'' permission is interpreted to mean permission to search the directory for a specified file. The character after permissions is ACL indication. A plus sign is displayed if there is an ACL associated with the file. Nothing is displayed if there are just permissions. ls -l (the long list) prints its output as follows: -rwxrwxrwx+ 1 smith dev 10876 May 16 9:42 part2 Reading from right to left, you see that the current direc- tory holds one file, named part2. Next, the last time that file's contents were modified was 9:42 A.M. on May 16. The file contains 10,876 characters, or bytes. The owner of the file, or the user, belongs to the group dev (perhaps indi- cating ``development''), and his or her login name is smith. The number, in this case 1, indicates the number of links to file part2; see cp(1). The plus sign indicates that there is an ACL associated with the file. Finally, the dash and letters tell you that user, group, and others have permis- sions to read, write, and execute part2. The execute (x) symbol here occupies the third position of the three-character sequence. A - in the third position would have indicated a denial of execution permissions. The permissions are indicated as follows: r the file is readable w the file is writable x the file is executable - the indicated permission is not granted s the set-user-ID or set-group-ID bit is on, and the corresponding user or group execution bit is also on t the 1000 (octal) bit, or sticky bit, is on (see chmod(1)), and execution is on For user and group permissions, the third position is some- times occupied by a character other than x or -. s also may occupy this position, referring to the state of the set-ID bit, whether it be the user's or the group's. The ability to assume the same ID as the user during execution is, for example, used during login when you begin as root but need to assume the identity of the user you login as. OPTIONS -a List all entries, including those that begin with a dot (.), which are normally not listed. -A List all entries, including those that begin with a dot (.), with the exception of the working directory (.) and the parent directory (..). -b Force printing of non-printable characters to be in the octal \ddd notation. -c Use time of last modification of the i-node (file created, mode changed, and so forth) for sorting (-t) or printing (-l or -n). -C Multi-column output with entries sorted down the columns. This is the default output format. -d If an argument is a directory, list only its name (not its contents); often used with -l to get the status of a directory. -F Put a slash (/) after each filename if the file is a directory, an asterisk (*) if the file is an execut- able, and an at-sign (@) if the file is a symbolic link. -g The same as -l, except that the owner is not printed. -l List in long format, giving mode, ACL indication, number of links, owner, group, size in bytes, and time of last modification for each file (see above). If the file is a special file, the size field instead contains the major and minor device numbers. If the time of last modification is greater than six months ago, it is shown in the format `month date year'; files modified within six months show `month date time.' If the file is a symbolic link, the filename is printed followed by "->" and the path name of the referenced file. -L If an argument is a symbolic link, list the file or directory the link references rather than the link itself. -p Put a slash (/) after each filename if the file is a directory. -q Force printing of non-printable characters in file names as the character question mark (?). -r Reverse the order of sort to get reverse alphabetic or oldest first as appropriate. -R Recursively list subdirectories encountered. -s Give size in blocks, including indirect blocks, for each entry. -t Sort by time stamp (latest first) instead of by name. The default is the last modification time. (See -u and -c.) -u Use time of last access instead of last modification for sorting (with the -t option) or printing (with the -l option). for more information, use the 'man ls' command.