&& Operator in Linux
&& operator (or AND operator) is used in bash scripting and in the terminal as well. When you use it in a terminal, it executes multiple commands in a single statement.
sudo apt update && sudo apt upgrade
Consider the single-line statement above. sudo apt update will execute (successfully) then the sudo apt upgrade command executes. If the sudo apt update fails or does not execute successfully, the sudo apt upgrade will also not execute.
In the attached screenshot below, you may notice that the sudo apt update did not execute successfully, then also the second statement didn’t execute.
You can also use this operator in scripting (when using multiple conditions).