ls (target)
List directory contents (POSIX, toybox)
Syntax:
ls [-1ACFHLNRSUXZabcdfghiklmnopqrstuwx] [--block-size n]
[--color[=[always | auto | never]] [-ll]
[--sort=longname,longname...] [file...]
Runs on:
QNX OS
Options:
- -1
- (
One
) List one file per line. - -!
- Sort using directory first.
- -~
- Case-insensitive sort.
- -A
- List all files but . (dot) and .. (dot dot).
- -a
- List all files, including hidden ones (i.e., those that start with a dot
(
.
)). - -b
- Display escapes for nongraphic characters.
- -block-size n
- Set block size. Default is 512 bytes.
- -C
- Display multiple-column output, with entries sorted vertically in columns.
- -c
- For sorting (-t) or printing (-l), use the time of last change to the file's status information (ctime) instead of time of last modification of the file itself.
- --color[=[always | auto | never]
- Color the output based on the file type.
- always—color the output (default).
- auto—color output when standard output is connected to a terminal ( tty).
- never—do not color the output.
- -d
- Treat directories like files; give information on the directory itself, not on the files or subdirectories it contains.
- -F
- Indicate the filetype by adding an extra character after some pathnames, as follows:
Character Meaning /
Directories *
Executable files (.exe files) |
FIFOs (named pipes) @
Symbolic links (QNX OS extension) - -f
- Show files. Enable -aU, disable -ls and --color.
- -g
- Like -l ("el") but don't list owner.
- -H
- Follow command-line symbolic links.
- -h
- With -l and -s, print human readable sizes.
- -i
- For each file, print the file's inode number.
- -k
- Set block size to 1024 bytes.
- -L
- Follow symbolic links.
- -l
- ("el") List files in long format. This option provides most of the relevant file information.
- -ll, --full-time
- ("el, el") List files in long format with nanoseconds.
- -m
- Fill the width with a comma-separated list of entries.
- -N
- No escaping, even on tty.
- -n
- Like -l ("el"), except display numeric user and group IDs.
- -o
- Like -l ("el"), but don't display the group column.
- -p
- Put a forward slash (/) after directory names.
- -q
- Force print filename characters that aren't included in the character set classification in the current locale to be displayed as a question mark (?).
- -R
- Recursively list all subdirectories encountered.
- -r
- Reverse the order of the sort to get either oldest files first (if files are being sorted by time) or reverse collating sequence.
- -S
- Sort by file size.
- -s
- Display the size of storage, in 512-byte blocks or size specified by --block-size.
- --sort=long_name,long_name...
- Sort using the long name of the property (see the corresponding option for
descriptions).Any conflicts that remain after the specified sorting are resolved by sorting alphabetically.
Long name Option atime
-u ctime
-c dirfirst
-! extension
-X reverse
-r nocase
-~ none
-U size
-S time
-t - -t
- Sort by time modified (most recently modified first).
- -U
- Don't sort.
- -u
- Use access time for timestamps.
- -w
- Set column width.
- -X
- Sort by extension.
- -x
- List entries by columns (sort horizontally).
- -Z
- Display any security context for each file.
- file
- The pathname of a file to be listed. If the file specified isn't found, a diagnostic message is output on standard error. Files are displayed in command-line sequence.
Description:
The ls utility displays file names and information requested on files.
This utility is provided as part of the toybox package. For information on how to enable it, see toybox.
Contributing author:
Rob Landley and the toybox project (see https://landley.net/toybox/).
Page updated: