Skip to content

Glossary: Command Line for IT: Bash and PowerShell

[ ]

Also written: test, [ -f FILE ], [ -d DIR ], [ -z ]

A bash command that only tests something (numbers with -lt or -gt, strings with =, files with -f or -d) and sets the exit code to 0 if the test is true. Keep a space inside each bracket, and quote variables.

Where the book teaches it

Related terms

ifexit code&&