Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ls(1) [minix man page]

LS(1)							      General Commands Manual							     LS(1)

ls - list the contents of a directory SYNOPSIS
ls [-acdfgilqrstu1ACFLMRTX] [name...] DESCRIPTION
For each file argument, list it. For each directory argument, list its contents. The current working directory is listed when no files are named. Information is printed multicolumn on terminals, single column if the output is redirected. The options control what informa- tion is shown and how. Ls has two sources other then the commands line to draw options from, one is the environment variable LSOPTS and is used only when the out- put of ls is displayed on a terminal. The other is the name of ls itself. If ls is linked to another name, then all the characters after the l are used as flags too, except that f, r, t and x are translated to F, R, T and X. Useful links are ll, lf, lm and lx. Files whose names start with a dot are by default not listed. Note that standard Minix doesn't have symbolic links or sockets and -u and -c are no-ops on a V1 file system, since only modified times are stored in V1 inodes. OPTIONS
-a All entries are listed, even . and .. -c Use inode changed time for sorting, listing or searching. -d Do not list contents of directories, but list the directory itself. -f Do not sort (should also be: treat a file as a directory, but that can't be implemented portably). -g Suppress the owner name on a long listing (implies -l). -i I-node number printed in first column. -l Long listing: mode, links, owner, group, size and time. (ls -lC uses columns in a wide enough window!) -n Print numerical user and group id's. -q Print nongraphic characters as '?' (default on terminals). -r Reverse the sort order. -s Give size in kilobytes. -t Sort by time (modified time default), latest first. -u Use last accessed time for sorting, listing or searching. -1 Print in one column. -A List all entries, but not . and .. (This is the default for privileged users.) -C Print multicolumn (default on terminals). -F Mark directories with a '/', executables with a '*', UNIX domain sockets with a '=' and symbolic links with a '@' behind the name. -L Print the file referenced by a symbolic link instead of the link. -M List mode before name (implies -C). -R List directory trees recursively. -T Group files by type, i.e. regular files together, directories together, etc. -X Print crunched mode and size before name (implies -C). Only the rwx permissions that its caller has on the file, but they are in upper case if the caller owns the file and has given the permission to the callers group or other users. The size is listed in bytes (<= 5K), or rounded up kilo, mega or gigabytes. SEE ALSO
du(1), stat(1), stat(2). BUGS
Having to type ls -C when viewing files through more(1). Is only portable to systems with the same st_mode (see stat(2)). The LSOPTS variable and the -M, -T and -X flags are not found on other ls implementations. (They have there own nonstandard flags.) AUTHOR
Kees J. Bot ( LS(1)

Check Out this Related Man Page

LS(1)							      General Commands Manual							     LS(1)

ls, lc - list contents of directory SYNOPSIS
ls [ -dlnpqrstuF ] name ... lc [ -dlnqrstuF ] name ... DESCRIPTION
For each directory argument, ls lists the contents of the directory; for each file argument, ls repeats its name and any other information requested. When no argument is given, the current directory is listed. By default, the output is sorted alphabetically by name. Lc is the same as ls, but sets the -p option and pipes the output through mc(1). There are a number of options: -d If argument is a directory, list it, not its contents. -l List in long format, giving mode (see below), file system type (e.g., for devices, the # code letter that names it; see Intro(4)), the instance or subdevice number, owner, group, size in bytes, and time of last modification for each file. -n Don't sort the listing. -p Print only the final path element of each file name. -q List the qid (see stat(2)) of each file. -r Reverse the order of sort. -s Give size in Kbytes for each entry. -t Sort by time modified (latest first) instead of by name. -u Under -t sort by time of last access; under -l print time of last access. -F Add the character / after all directory names and the character * after all executable files. The mode printed under the -l option contains 11 characters, interpreted as follows: the first character is d if the entry is a directory; a if the entry is an append-only file; - if the entry is a plain file. The next letter is l if the file is exclusive access (one writer or reader at a time). The last 9 characters are interpreted as three sets of three bits each. The first set refers to owner permissions; the next to permissions to others in the same user-group; and the last to all others. Within each set the three characters indicate permission respectively to read, to write, or to execute the file as a program. For a directory, `execute' permission is interpreted to mean permission to search the directory for a specified file. The permissions are indicated as follows: r if the file is readable; w if the file is writable; x if the file is executable; - if none of the above permissions is granted. SOURCE
/sys/src/cmd/ls.c /rc/bin/lc SEE ALSO
stat(2) mc(1) LS(1)
Man Page

Featured Tech Videos