# info > Common options

---
type: CommandReference
command: coreutils
mode: info
section: 2
source: info
---

## Quick Reference

- `command --help` — print usage message then exit
- `command --version` — print version number then exit
- `command --` — delimit option list; treat later arguments as operands
- `command -` — read from standard input (where a file operand is expected)
- `command -b` or `command --backup[=METHOD]` — make backup of files before overwriting
- `command -S SUFFIX` or `command --suffix=SUFFIX` — set backup suffix
- `command --block-size=SIZE` — set display block size (e.g., `human-readable`, `si`, `1K`)
- `command -h` or `command --human-readable` — equivalent to `--block-size=human-readable`
- `command --si` — equivalent to `--block-size=si`
- `command -H` — traverse symbolic links to directories on command line (with `-R`)
- `command -L` — traverse all symbolic links to directories (with `-R`)
- `command -P` — do not traverse symbolic links (default)
- `command -T` or `command --no-target-directory` — treat last operand as normal file, not directory
- `command -t DIRECTORY` or `command --target-directory=DIRECTORY` — use DIRECTORY as target for all operands
- `command --strip-trailing-slashes` — remove trailing slashes from each SOURCE argument
- `command --preserve-root` — do not operate recursively on `/`
- `command --no-preserve-root` — allow operation on `/`
- `command --random-source=FILE` — use FILE as source of random data

## Name

Common options for GNU coreutils programs — options available in all coreutils commands.

## Synopsis

command [OPTION]... [OPERAND]...
Options and operands can appear in any order unless `POSIXLY_CORRECT` is set (then options must precede operands). Long options accept unambiguous abbreviations.

## Options

### General Options

- `--help` — print usage message listing all available options, then exit successfully
- `--version` — print version number, then exit successfully
- `--` — delimit the option list; later arguments are treated as operands even if they begin with `-`
- A single `-` operand stands for standard input (or standard output if context clear)

### Backup Options (for `cp`, `install`, `ln`, `mv`)

- `-b`, `--backup[=METHOD]` — make backup of each file that would otherwise be overwritten/removed; without this option, originals are destroyed. METHOD can be:
  - `none` or `off` — never make backups
  - `numbered` or `t` — always make numbered backups
  - `existing` or `nil` — make numbered backups if already exist, else simple
  - `simple` or `never` — always make simple backups
  - If METHOD not specified, uses `VERSION_CONTROL` env var; default is `existing`
- `-S SUFFIX`, `--suffix=SUFFIX` — append SUFFIX to backup files; default from `SIMPLE_BACKUP_SUFFIX` env var, else `~`

### Block Size Options (for `df`, `du`, `ls`)

- `--block-size=SIZE` — override default block size. SIZE can be:
  - Positive integer (bytes per block)
  - `human-readable` — powers of 1024 with size letter (e.g., `M` for 1,048,576)
  - `si` — powers of 1000 with size letter and `B` (e.g., `MB` for 1,000,000)
  - Integer with optional suffix: `kB` (1000), `k`/`K`/`KiB` (1024), `MB` (10^6), `M`/`MiB` (2^20), `GB` (10^9), `G`/`GiB` (2^30), `TB` (10^12), `T`/`TiB` (2^40), `PB` (10^15), `P`/`PiB` (2^50), `EB` (10^18), `E`/`EiB` (2^60), `ZB` (10^21), `Z`/`ZiB` (2^70), `YB` (10^24), `Y`/`YiB` (2^80)
  - Precede with `'` to add thousands separators (locale-dependent)
- `-k` — equivalent to `--block-size=1K` (default unless `POSIXLY_CORRECT`)
- `-h`, `--human-readable` — equivalent to `--block-size=human-readable`
- `--si` — equivalent to `--block-size=si`

Block size environment variables (first set wins): `DF_BLOCK_SIZE`, `DU_BLOCK_SIZE`, `LS_BLOCK_SIZE`, `BLOCK_SIZE`, `BLOCKSIZE`, `POSIXLY_CORRECT` (defaults to 512). If none set, default is 1024 bytes (1 byte for `ls` file sizes).

### Floating Point Numbers

- Commands accept scientific notation (`1.0e-34`), case-insensitive `inf`, `infinity`, `NaN`, and hexadecimal floats (`-0x.ep-3`)
- Decimal point character from `LC_NUMERIC` locale; some commands accept both current and C locale separators

### Signal Specifications

A signal can be specified by name (canonical or with `SIG` prefix), number, or exit status of a process terminated by the signal. Common signals:

- `HUP` (1), `INT` (2), `QUIT` (3), `ABRT` (6), `KILL` (9), `ALRM` (14), `TERM` (15)
- Additional POSIX signals: `BUS`, `CHLD`, `CONT`, `FPE`, `ILL`, `PIPE`, `SEGV`, `STOP`, `TSTP`, `TTIN`, `TTOU`, `URG`, `USR1`, `USR2`
- XSI extension: `POLL`, `PROF`, `SYS`, `TRAP`, `VTALRM`, `XCPU`, `XFSZ`
- Real-time signals: `RTMIN`, `RTMIN+1`, ..., `RTMAX-1`, `RTMAX`

### Disambiguating User/Group Names and IDs

- For `chown`, `chgrp`, `chroot`, `id`: precede numeric user/group ID with `+` to force numeric interpretation (e.g., `chown +42 F`). This skips name lookup.

### Random Data Sources

- `--random-source=FILE` — use FILE as source of random data (for `shuf`, `shred`, `sort`). Default is internal pseudo-random generator.
- Common sources: `/dev/urandom`, `/dev/random`, `/dev/arandom`
- To reproduce results, save random data to a file and reuse it; or generate reproducible data with OpenSSL and process substitution

### Target Directory Options (for `cp`, `install`, `ln`, `mv`)

- `-T`, `--no-target-directory` — treat last operand as normal file, even if it is a directory
- `-t DIRECTORY`, `--target-directory=DIRECTORY` — use DIRECTORY as target directory for all source files (useful with `xargs`)

### Trailing Slashes

- `--strip-trailing-slashes` — remove trailing slashes from each SOURCE argument before operating on it (useful for symlinks to directories)

### Symlink Traversal (with `-R` for `chown`, `chgrp`)

- `-H` — traverse command-line symbolic links to directories
- `-L` — traverse all encountered symbolic links to directories
- `-P` — do not traverse symbolic links (default)

### Treating `/` Specially

- `--preserve-root` — do not operate recursively on `/` (default for `rm`; for `chgrp`, `chmod`, `chown` must be specified explicitly)
- `--no-preserve-root` — allow operation on `/` (default for `chgrp`, `chmod`, `chown`)

### Environment Variables

- `POSIXLY_CORRECT` — force options before operands, block size 512, and POSIX-compatible behavior
- `VERSION_CONTROL` — default backup method (used by `-b` without argument)
- `SIMPLE_BACKUP_SUFFIX` — default backup suffix (overridden by `-S`)
- `_POSIX2_VERSION` — set to `199209`, `200112`, or `200809` to specify POSIX version conformance
- `LC_NUMERIC` — decimal point character for floating point

### Multi-call Invocation

- `coreutils --coreutils-prog=PROGRAM ...` — invoke an individual utility by name (not installed by default)

## Examples

shell
# Force numeric user/group ID interpretation
chown +42 F
chgrp +$numeric_group_id another-file
chown +0:+0 /
shell
# Use --target-directory with xargs to move files to sibling directory
ls | xargs mv -t ../d --
shell
# Safer variant with find and xargs (handles blanks and special chars)
find . -mindepth 1 -maxdepth 1 -print0 \
  | xargs --null --no-run-if-empty mv -t ../d
shell
# Reproducible random source for shuf
get_seeded_random() {
  seed="$1"
  openssl enc -aes-256-ctr -pass pass:"$seed" -nosalt \
    </dev/zero 2>/dev/null
}
shuf -i1-100 --random-source=<(get_seeded_random 42)
## Exit Codes

- `0` — success
- Non-zero (typically `1`) — failure
- Exceptions where `0` and `1` may have different meanings: `chroot`, `env`, `expr`, `nice`, `nohup`, `numfmt`, `printenv`, `sort`, `stdbuf`, `test`, `timeout`, `tty`

## See Also

- [coreutils manual](https://www.gnu.org/software/coreutils/manual/coreutils.html)
- Individual commands: `cp`, `mv`, `ln`, `install`, `df`, `du`, `ls`, `chown`, `chgrp`, `rm`, `shuf`, `shred`, `sort`, `env`, `nice`, `nohup`, `xargs`, `find`