Man page - rust-test(1)
Packages contas this manual
- rust-vdir(1)
- rust-basename(1)
- rust-base64(1)
- rust-rm(1)
- rust-uname(1)
- rust-rmdir(1)
- rust-join(1)
- rust-nproc(1)
- rust-realpath(1)
- rust-tac(1)
- rust-false(1)
- rust-unexpand(1)
- rust-more(1)
- rust-link(1)
- rust-split(1)
- rust-id(1)
- rust-date(1)
- rust-printf(1)
- rust-chcon(1)
- rust-who(1)
- rust-nl(1)
- rust-du(1)
- rust-fmt(1)
- rust-pinky(1)
- rust-chroot(1)
- rust-df(1)
- rust-nohup(1)
- rust-stat(1)
- rust-dircolors(1)
- rust-nice(1)
- rust-tsort(1)
- rust-dirname(1)
- rust-touch(1)
- rust-basenc(1)
- rust-dir(1)
- rust-tail(1)
- rust-mkdir(1)
- rust-dd(1)
- rust-true(1)
- rust-wc(1)
- rust-hashsum(1)
- rust-head(1)
- rust-uptime(1)
- rust-expr(1)
- rust-sum(1)
- rust-timeout(1)
- rust-hostname(1)
- rust-test(1)
- rust-chgrp(1)
- rust-runcon(1)
- rust-ln(1)
- rust-comm(1)
- rust-truncate(1)
- rust-shred(1)
- rust-coreutils(1)
- rust-expand(1)
- rust-hostid(1)
- rust-printenv(1)
- rust-cut(1)
- rust-tr(1)
- rust-ptx(1)
- rust-chown(1)
- rust-paste(1)
- rust-groups(1)
- rust-pwd(1)
- rust-users(1)
- rust-pathchk(1)
- rust-ls(1)
- rust-arch(1)
- rust-unlink(1)
- rust-mktemp(1)
- rust-cksum(1)
- rust-readlink(1)
- rust-od(1)
- rust-seq(1)
- rust-yes(1)
- rust-cp(1)
- rust-sync(1)
- rust-pr(1)
- rust-logname(1)
- rust-fold(1)
- rust-cat(1)
- rust-install(1)
- rust-chmod(1)
- rust-echo(1)
- rust-mknod(1)
- rust-base32(1)
- rust-mkfifo(1)
- rust-sleep(1)
- rust-whoami(1)
- rust-tee(1)
- rust-shuf(1)
- rust-uniq(1)
- rust-tty(1)
- rust-sort(1)
- rust-kill(1)
- rust-mv(1)
- rust-env(1)
- rust-csplit(1)
- rust-numfmt(1)
apt-get install rust-coreutils
Manual
| test(1) | General Commands Manual | test(1) |
NAME
test - Check file types and compare values.
SYNOPSIS
test [-h|--help] [-V|--version]
DESCRIPTION
Check file types and compare values.
OPTIONS
- -h, --help
- Print help
- -V, --version
- Print version
EXTRA
Exit with the status determined by EXPRESSION.
An omitted EXPRESSION defaults to false. Otherwise, EXPRESSION is true or false and sets exit status.
It is one of:
* ( EXPRESSION ) EXPRESSION is true * ! EXPRESSION EXPRESSION is false * EXPRESSION1 -a EXPRESSION2 both EXPRESSION1 and EXPRESSION2 are true * EXPRESSION1 -o EXPRESSION2 either EXPRESSION1 or EXPRESSION2 is true
String operations: * -n STRING the length of STRING is nonzero * STRING equivalent to -n STRING * -z STRING the length of STRING is zero * STRING1 = STRING2 the strings are equal * STRING1 != STRING2 the strings are not equal
Integer comparisons: * INTEGER1 -eq INTEGER2 INTEGER1 is equal to INTEGER2 * INTEGER1 -ge INTEGER2 INTEGER1 is greater than or equal to INTEGER2 * INTEGER1 -gt INTEGER2 INTEGER1 is greater than INTEGER2 * INTEGER1 -le INTEGER2 INTEGER1 is less than or equal to INTEGER2 * INTEGER1 -lt INTEGER2 INTEGER1 is less than INTEGER2 * INTEGER1 -ne INTEGER2 INTEGER1 is not equal to INTEGER2
File operations: * FILE1 -ef FILE2 FILE1 and FILE2 have the same device and inode numbers * FILE1 -nt FILE2 FILE1 is newer (modification date) than FILE2 * FILE1 -ot FILE2 FILE1 is older than FILE2
* -b FILE FILE exists and is block special * -c FILE FILE exists and is character special * -d FILE FILE exists and is a directory * -e FILE FILE exists * -f FILE FILE exists and is a regular file * -g FILE FILE exists and is set-group-ID * -G FILE FILE exists and is owned by the effective group ID * -h FILE FILE exists and is a symbolic link (same as -L) * -k FILE FILE exists and has its sticky bit set * -L FILE FILE exists and is a symbolic link (same as -h) * -N FILE FILE exists and has been modified since it was last read * -O FILE FILE exists and is owned by the effective user ID * -p FILE FILE exists and is a named pipe * -r FILE FILE exists and read permission is granted * -s FILE FILE exists and has a size greater than zero * -S FILE FILE exists and is a socket * -t FD file descriptor FD is opened on a terminal * -u FILE FILE exists and its set-user-ID bit is set * -w FILE FILE exists and write permission is granted * -x FILE FILE exists and execute (or search) permission is granted
Except for -h and -L, all FILE-related tests dereference (follow) symbolic links. Beware that parentheses need to be escaped (e.g., by backslashes) for shells. INTEGER may also be -l STRING, which evaluates to the length of STRING.
NOTE: Binary -a and -o are inherently ambiguous. Use test EXPR1 && test EXPR2 or test EXPR1 || test EXPR2 instead.
NOTE: [ honors the --help and --version options, but test does not. test treats each of those as it treats any other nonempty STRING.
NOTE: your shell may have its own version of test and/or [, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports.
VERSION
v0.0.30
| test 0.0.30 |