1、管道
1.1、功能:使用管道控制进程命令输出到其他程序命令
1.2、管道符号 |
1.3、实例:
[root@centos6 ~]
root 1 0 0 15:53 ? 00:00:01 /sbin/init
root 2720 2306 0 16:31 pts/0 00:00:00 grep init
[root@centos6 ~]
9 /bin/bash
1 /bin/sync
1 /sbin/halt
26 /sbin/nologin
1 /sbin/shutdown
[root@centos6 ~]
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
inet 192.168.24.129/24 brd 192.168.24.255 scope global eth1
inet6 fe80::20c:29ff:fec4:e8ab/64 scope link
[root@centos6 ~]
[root@centos6 ~]
[root@centos6 ~]
inet 127.0.0.1/8 scope host lo
inet 192.168.24.129/24 brd 192.168.24.255 scope global eth1
2、tee管道
2.1、功能:在不影响其它管道的情况下定向输出结果到文件或终端
2.2 实例:
[root@centos6 ~]
45
[root@centos6 ~]
[root@centos6 ~]
45
[root@centos6 ~]
[root@centos6 ~]
45%
[root@centos6 ~]
[root@centos6 ~]
[root@centos6 ~]
45
[root@centos6 ~]
/dev/sda2 7.6G 3.2G 4.0G 45% /
[root@centos6 ~]
[root@centos6 ~]
45
[root@centos6 ~]
/dev/sda2 7.6G 3.2G 4.0G 45% /
/dev/sda2 7.6G 3.2G 4.0G 45% /
[root@centos6 ~]
[root@centos6 ~]
2019年 09月 24日 星期二 19:46:43 CST
[root@centos6 ~]
[root@centos6 ~]
2019年 09月 24日 星期二 19:46:43 CST