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

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.

主站蜘蛛池模板: 潼南县| 阜宁县| 钟山县| 黄陵县| 安化县| 扎兰屯市| 香港| 临城县| 嘉祥县| 营口市| 饶平县| 乌兰浩特市| 剑川县| 易门县| 昆山市| 温宿县| 晋中市| 永川市| 伊金霍洛旗| 三亚市| 乌拉特后旗| 奉节县| 大关县| 和田市| 航空| 临桂县| 留坝县| 靖远县| 呼图壁县| 时尚| 江永县| 五莲县| 浏阳市| 沐川县| 桦南县| 鱼台县| 南陵县| 库伦旗| 新平| 克什克腾旗| 凉城县|