Conditionals are the primary means of making decisions in programming, especially Bash scripting. Conditionals in Bash are with the [
and [[
built-ins, which are also commands! It makes reasoning about conditionals challenging at first, but there are some useful flags available:
-a file
-b file
-c file
-d file
-e
-a
.-f file
-h file
-r file
-s file
-w file
-x file
-v arg
man bash
— See "CONDITIONAL EXPRESSIONS"