The operator &
(Ampersand) is used to put the previous command on background and, if there is a later command, it will be executed independent of the result of the previous command:
free & sync
When this operator is used at the end of a command on a Linux terminal, it means that you want to run that command and already release the terminal for new commands, without waiting for the result of the last command:
wget http://answall.com &
The operator &&
(AND) is used so that the next command will only be executed if the previous command has been successfully executed (exist status
equal to 1):
mkdir pasta && cd pasta
More details you can find here.
Correct me if necessary! I don’t know the difference between terminal, shell and bash
– Wallace Maxters
Only one reference for learning, which I am using and may be useful, https://www.codecademy.com/pt/courses/learn-the-command-line
– Guilherme Lautert
It would be nice to take a look at this answer: http://answall.com/questions/72969/cmd-console-ms-dos-e-relatedthermos-related
– Jéf Bueno