Skip to content

Test

test

Exit with the status determined by EXPRESSION. Mostly used with if.

test EXPRESSION
if ! test -f /path/to/file; then
  echo "File does not exist."
fi

same as

if ! [ -f /path/to/file ]; then
  echo "File does not exist."
fi