ls <name...>

List directory contents

Arguments

NameDescription
namefilepaths, folders

Options

NameDescription
-@Display extended attribute keys and sizes in long (-l) output
-1(The numeric digit ``one''.) Force output to be one entry per line. This is the default when output is not to a terminal
-AList all entries except for . and ... Always set for the super-user
-aInclude directory entries whose names begin with a dot (.)
-BForce printing of non-printable characters (as defined by ctype(3) and current locale settings) in file names as xxx, where xxx is the numeric value of the character in octal
-bAs -B, but use C escape codes whenever possible
-CForce multi-column output; this is the default when output is to a terminal
-cUse time when file status was last changed for sorting (-t) or long printing (-l)
-dDirectories are listed as plain files (not searched recursively)
-ePrint the Access Control List (ACL) associated with the file, if present, in long (-l) output
-FDisplay a slash (/) immediately after each pathname that is a directory, an asterisk (*) after each that is executable, an at sign (@) after each symbolic link, an equals sign (=) after each socket, a percent sign (%) after each whiteout, and a vertical bar (|) after each that is a FIFO
-fOutput is not sorted. This option turns on the -a option
-GEnable colorized output. This option is equivalent to defining CLICOLOR in the environment. (See below.)
-gThis option is only available for compatibility with POSIX; it is used to display the group name in the long (-l) format output (the owner name is suppressed)
-HSymbolic links on the command line are followed. This option is assumed if none of the -F, -d, or -l options are specified
-hWhen used with the -l option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to three or less using base 2 for sizes
-iFor each file, print the file's file serial number (inode number)
-kIf the -s option is specified, print the file size allocation in kilobytes, not blocks. This option overrides the environment variable BLOCKSIZE
-LFollow all symbolic links to final target and list the file or directory the link references rather than the link itself. This option cancels the -P option
-l(The lowercase letter ``ell''.) List in long format. (See below.) A total sum for all the file sizes is output on a line before the long listing
-mStream output format; list files across the page, separated by commas
-nDisplay user and group IDs numerically, rather than converting to a user or group name in a long (-l) output. This option turns on the -l option
-OInclude the file flags in a long (-l) output
-oList in long format, but omit the group id
-PIf argument is a symbolic link, list the link itself rather than the object the link references. This option cancels the -H and -L options
-pWrite a slash (`/') after each filename if that file is a directory
-qForce printing of non-graphic characters in file names as the character `?'; this is the default when output is to a terminal
-RRecursively list subdirectories encountered
-rReverse the order of the sort to get reverse lexicographical order or the oldest entries first (or largest files last, if combined with sort by size
-SSort files by size
-sDisplay the number of file system blocks actually used by each file, in units of 512 bytes, where partial units are rounded up to the next integer value. If the output is to a terminal, a total sum for all the file sizes is output on a line before the listing. The environment variable BLOCKSIZE overrides the unit size of 512 bytes
-TWhen used with the -l (lowercase letter ``ell'') option, display complete time information for the file, including month, day, hour, minute, second, and year
-tSort by time modified (most recently modified first) before sorting the operands by lexicographical order
-uUse time of last access, instead of last modification of the file for sorting (-t) or long printing (-l)
-UUse time of file creation, instead of last modification for sorting (-t) or long output (-l)
-vForce unedited printing of non-graphic characters; this is the default when output is not to a terminal
-WDisplay whiteouts when scanning directories. (-S) flag)
-wForce raw printing of non-printable characters. This is the default when output is not to a terminal
-xThe same as -C, except that the multi-column output is produced with entries sorted across, rather than down, the columns
-%Distinguish dataless files and directories with a '%' character in long (-l) output, and don't materialize dataless directories when listing them
-,When the -l option is set, print file sizes grouped and separated by thousands using the non-monetary separator returned by localeconv(3), typically a comma or period. If no locale is set, or the locale does not have a non-monetary separator, this option has no effect. This option is not defined in IEEE Std 1003.1-2001 (“POSIX.1”)
--color <when>Output colored escape sequences based on when, which may be set to either always, auto, or never