96
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.
Example:
Look at the above snapshot, both the commands are successfully executed.
Let’s see an example of failed command.
Example:
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.
Next TopicDouble Vertical Bar