LS(1) General Commands Manual LS(1)

lslist directory contents

ls [-giklnoqrs] [-A | -a] [-1 | -C | -m | -x] [-F | -p] [-H | -L] [-R | -d] [-S | -f | -t] [-c | -u] [file ...]

The ls utility writes each given file, and the contents of each given directory to the standard output. If no file is given the contents of the current directory are written on the standard output.

Output one entry per-line.
List all entries except for ‘.’ and ‘..’.
List entries whose name begin with a dot (‘.’), along with the default output.
Output multi-column entries sorted down the columns.
Use time file's status was last changed for sorting or writing.
Treat directories as plain files.
Append a file type indicator to all special files.
Do not sort. This option implies -a.
Supress owner name. This option implies -l.
Follow symbolic links on the command line.
Write the inode number of each file.
Set the block size to 1024 bytes.
Follow all symbolic links.
Output entries in long format.
Output entries across the page, separated by commas.
Write user and group IDs in a numeric format. This option implies -l.
Supress group. This option implies -l.
Append a file type indicator to directories.
Replace non-printable characters in filename with ‘?’.
Descend recursively through its directories arguments.
Reverse the sort order.
Sort files by size, in decreasing order.
Write the number of file system blocks actually used by each file.
Use file's last modification time for sorting or writing.
Use file's last access time for sorting or writing.
Output multi-column entries sorted across the page.

The long format consists of the entry type, permissions, links, owner, group, size or major and minor numbers if the file is a character/block device, and last file modification time.

The mode field consists of eleven characters. The first character describes the type entry:

-
Regular file.
Block special file.
Character special file.
Directory.
Symbolic link.
FIFO

The last nine characters are interpreted as three sets of three bits each. The first set refers to the owner permissions; the next to group permissions; and the last to others permissions. Within each set, the three characters indicate permission to read, to write, and to execute, respectively. The permissions are indicated as follow:

-
The indicated permission is not granted.
The file is readable.
The set-user-ID or set-group-ID is on, and execution is off.
The set-user-ID or set-group-ID is on, and execution is on.
The sticky bit is set, and execution is off.
The sticky bit is set, and execution is on.
The file is writable.
The file is executable.

Output is formatted to the given width in columns. Otherwise, ls defaults to 80 columns.

The ls utility exits 0 on success, and >0 if an error occurs.

find(1)

The ls utility is compliant with the specification.

January 26, 2020 EltaninOS