官术网_书友最值得收藏!

Command1 && command2

The second command is only started if the first command is successful. To achieve this, the shell checks the exit (return) status of the first command and starts the second command only if and when that exit status is found to be 0:

    $ ls /home/ganesh  &&  echo "Command executed successfully"
    Since we are working as user ganesh,
    $ ls /root  && echo "Command executed successfully"

Since we are working as a normal user, we cannot access the /root directory. Therefore, nothing will be printed on screen.

主站蜘蛛池模板: 峡江县| 象山县| 沙雅县| 佛山市| 芦山县| 宁陕县| 万山特区| 岢岚县| 南开区| 南安市| 泊头市| 临漳县| 扎囊县| 兰考县| 吉林市| 聂拉木县| 唐海县| 沅江市| 海城市| 新和县| 太和县| 基隆市| 德州市| 延庆县| 津市市| 达日县| 威远县| 湘西| 遂川县| 灌阳县| 大埔区| 从江县| 格尔木市| 宝坻区| 曲松县| 巴马| 萨嘎县| 香格里拉县| 花垣县| 麟游县| 江北区|