&& Is the logical AND:
&& is a way of expressing Logical AND, meaning the entire expression is True only if both sides of it are true. In logic, it is said the the entire statement (P&Q) is only true when both P and Q are true.
As a consequence of this, computers generally treat P&Q as a short-circuit evaluation. So since the entire statement will only be True if Both P and Q are true, then if P is false, the statement Q is not evaluated. Basically computers are lazy (efficient), and don't bother evaluating Q if they don't have too. This is also True of logical OR, see the previous link.
The Three Contexts of && in Bash:
1) Using Short-Circuit Evaluation with the exit status of a Command:
Every command has an exit status. If a command has an error the it has an exit status that is non-zero. So if the exit status is non-zero and && is used to chain commands together into a statement, later commands won't be evaluated (executed) if the earlier one did not have an exit status of 0 (True). This is because of short-circuit evaluation. So if you have:
P && Q
Q will not be executed if P was not true ( if P exits with a status of anything but 0, it is not true). Just the same as:
./configure && make
make will not be executed if configure had an error, wasn't true. So basically, then ends up being a way of writing in if then statement:
if ./configure ; then
make
fi
Keep in mind then in most contexts 0 is false, but not when it comes to an exit status.
2) && Can be Used in Bash's built in [[ ]] test command:
&& Can also be used inside of the built-in test command in bash [[ ]] to combine expressions in a similar fashion as combining commands. The entire test operation will only be true if both operands (sides) of && are true, for example:
if [[ ( $a -gt 2 ) && ( $a -lt 5 ) ]]; then ...
would be a way of saying if $a is an integer between 2 and 5 (not including 2 and 5).
3) Arithmetic Evaluation:
Lastly, && can be used in arithmetic evaluation as Logical AND. If both (logical AND) of the numbers in the following are non-zero, it returns 0, else 1 is returned:
kbrandt@desktop:~/$ echo $((1 & 1))
1
kbrandt@desktop:~/$ echo $((0 && 1))
0