Javatpoint Logo
Javatpoint Logo

Linux Double Ampersand (&&)

The command shell interprets the && as the logical AND. When using this command, the second command will be executed only when the first one has been succcefully executed.


Linux Double Ampersand1

Look at the above snapshot, both the commands are successfully executed.

Let's see an example of failed command.


Linux Double Ampersand2

Look at the above snapshot, in first case "rmdir sample && ls" is successfully executed but in the second case directory 'sample' was already removed and hence second command 'ls' is failed and not executed.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA