[ is an alias for the program test, so you can call man test for more info. && is bash syntax for conjunction. In A && B, B will only be called if A returned a exit code >0 (error). You can call man bash for more info. || is bash syntax for disjunction. In A || B, B will only be called if A returned exit code =0 (success).
true and false are programs that just return exit codes 0 respectively 1.
Explanation
[
is an alias for the programtest
, so you can callman test
for more info.&&
is bash syntax for conjunction. In A && B, B will only be called if A returned a exit code >0 (error). You can callman bash
for more info.||
is bash syntax for disjunction. In A || B, B will only be called if A returned exit code =0 (success).true
andfalse
are programs that just return exit codes 0 respectively 1.