管道 | 的使用

语法:command-a | command-b | command-c | ......

image.png

注意:

1、管道命令只处理前一个命令正确输出,不处理错误输出

2、管道右边的命令,必须能够接收标准输入的数据流命令才行

3、管道符可以把两条命令连起来,它可以链接多个命令使用

[root@xuegod63 ~]# ps -axu | grep sshd

root      1089  0.0  0.2 105996  4088 ?        Ss   20:19   0:00 /usr/sbin/sshd -D

root     43262  0.0  0.0 112680   984 pts/1    S+   21:36   0:00 grep --color=auto sshd

版权声明:
作者:WaterBear
链接:https://l-t.top/1392.html
来源:雷霆运维
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>