Test

From LQWiki
Jump to: navigation, search

The test command is used in shell commands to test various conditions. This is most useful in shell scripts.

Provided by

Most shells provide this as a builtin, but this is also present in the GNU Coreutils as a utility. The two forms may have different behavior. Most (all?) Linux distributions incorporate the utility from the GNU Coreutils: man page

Related Commands

  • false - gives exit status 1.
  • true - gives exit status 0.
  • expr - evaluates an expression, result to stdout

See also

shell scripting

This article is a stub and needs to be finished. Plunge forward and help it grow!