$ sudo apt-get update;sudo apt-get install some-tool;some-tool 让它自己运行
有时候,下一条命令依赖前一条命令是否执行成功。如:在成功地执行一条命令之后再执行另一条命令,或者在一条命令执行失败后再执行另一条命令等。shell 提供了 && 和 || 来实现命令执行控制的功能,shell 将根据 && 或 || 前面命令的返回值来控制其后面命令的执行。
语法格式如下:
command1 && command2 [&& command3 ...]
命令之间使用 && 连接,实现逻辑与的功能。
只有在 && 左边的命令返回真(命令返回值 $? == 0),&& 右边的命令才会被执行。
只要有一个命令返回假(命令返回值 $? == 1),后面的命令就不会被执行。
####4、cowsay:动物说话的命令,
使用其他动物
cowsay -f 动物类型 说话内容
$ cut /etc/passwd -c -5
$ cut /etc/passwd -c 5-
$ cut /etc/passwd -c 5
$ cut /etc/passwd -c 2-5
$ wc /etc/passwd
$ wc -l /etc/passwd
$ wc -w /etc/passwd
$ wc -c /etc/passwd
$ wc -m /etc/passwd
$ wc -L /etc/passwd
$ history | cut -c 8- | cut -d ' ' -f 1 | sort | uniq -dc
$ history | cut -c 8- | cut -d ' ' -f 1 | sort | uniq -D
学习时间 47分钟
操作时间 42分钟
按键次数 1411次
实验次数 2次
报告字数 4279字
是否完成 完成