The &
(Ampersand) operator is used to put the previous command in background and, if there is a subsequent command, it will run regardless of the result of the previous command:
free & sync
When this operator is used at the end of a command on a terminal in Linux, it means that you want to execute that command and release the terminal for new commands without waiting for the result of the last command:
wget http://pt.stackoverflow.com &
The &&
(AND) operator is used so that the next command is executed only if the previous command has been successfully executed ( exist status
equal to 1):
mkdir pasta && cd pasta
More details can be found here .