The following options can be used:
-1
|Force output to be one entry per line.
-R
|Recursively list subdirectories encountered.
-l
|List files/directories in long format.
-a
|List all files/directories including "." and ".."
-A
|List all files/directories except for "." and ".."
-h
|When 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.
-e
|Print the Access Control List (ACL) associated with the file, if present, in long (-l) output.
-S
|Sort files by size.
-t
|Sort by time modified (most recently modified first) before sorting the operands by lexicographical order.
-u
|Use time of last access, instead of last modification of the file for sorting (-t) or long printing (-l).
-U
|Use time of file creation, instead of last modification for sorting (-t) or long output (-l).
-r
|Reverse 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.
-T
|When used with the -l option, display complete time information for the file, including month, day, hour, minute, second.
-F
|Display a slash ('/') immediately after each pathname that is a directory,
|an asterisk ('*') after each file 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 file that is a FIFO.
-i
|For each file, print the file's file serial number (inode number).
-n
|Display 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.
-O
|Include the file flags in a long (-l) output.
-G
|Enable colorized output.
Option "
-l" (long display):
The "
-l" provides more information about files and directories.
The first line of the output display the total number of blocks contained within the directory.
The following lines list details of each file and directory.
Each line provides the following information:
- The type of the file.
- Permissions of the file.
- The Number of file hard links.
- The user name of the owner of the file.
- The group name of the primary group of the file.
- The byte size of the file.
- The last time the file was modified.
- The file name.
-
The option "-l" shows the following characters for the type of the file:
-: Regular file.
d: Directory.
l: Symbolic link (linked file).
b: Block special file (block device).
c: Character special file (character device).
s: Socket link.
p: FIFO.
-
The option "-l" shows the following characters for the permissions of the file:
r: the file is readable (or you can open the directory).
w: the file is writable (or you can add/delete files or directories to/from the directory).
x: the file is executable (or the directory is searchable).
-: the file is | not readable | not writable | not executable.
For a specific command file, you might see the s character instead of the x character (-rwsrwsr--).
The s character can be set for the user permissions (setuid: set user id on execution) or/and group permissions (setgid: set group id on execution).
This allow a user to execute the command but the ownership of the running command will be hold by the user or group owning the command.
For some directories, you might see the t character instead of the x character in other's permissions (drwxrwxr-t).
This indicate that the sticky bit was enabled for them, which means that users can add or delete files in those directories
but they cannot delete each other's files.
For some files and directories, you might see the + character at the end of the permissions bits (-rwsrwsr--+).
This means that those files and directories have extra attributes assigned to them (i.e. ACLs).