|
CentOS Linux Server Guide |
Centos Linux Command Line Operation |
||
Using "&&" symbol
In contrast with ";" symbol, you use this symbol to ensure both only first command is success then the system will only proceed with second command.
SYNOPSIS command && command
In the following example, first we change to /demo, then we list the contents at /demo directory. Note: first command is valid then we proceed with second command.
In the following example, first, we change to /etc/passwd (which is file,NOT a directory), then we ls all the files and folders. Note: first command is fail, the system will stop processing second command and issue us with stderr (error output to screen)
|
||
|
Copyright 2011 http://www.1a-centosserver.com All Rights Reserved All trademarks are the property of their respective owners. Contact Us | Terms of Use | Privacy Policy |