Linux中的管道符
来源:互联网 发布:2016淘宝有哪些购物节 编辑:程序博客网 时间:2024/06/03 14:11
一 多命令顺序执行
二 实战
[root@localhost local]# date;ls;cd /etc;pwd
Sat Jul 15 16:42:39 CST 2017
access.log cs.log etc go jdk1.8.0_111 lib libexec share test2.log test.log
bin error.log games include jdk-8u111-linux-x64.tar.gz lib64 sbin src test3.log
/etc
[root@localhost etc]# date;find /tmp/abc;date
Sat Jul 15 16:48:01 CST 2017
/tmp/abc
Sat Jul 15 16:48:01 CST 2017
[root@localhost etc]# cd ~
[root@localhost ~]# ls && echo yes
anaconda-ks.cfg Documents gobin goproject japan Pictures test
ChangeLog-2.6.0 Downloads goc2p hello.shell linux-2.6.39.tar.bz2 Public Videos
Desktop go1.8.3.linux-amd64.tar.gz golib initial-setup-ks.cfg Music Templates
yes
[root@localhost ~]# lsfdf && echo yes
bash: lsfdf: command not found...
root@localhost ~]# lsfdf || echo yes
bash: lsfdf: command not found...
yes
[root@localhost ~]# ls || echo yes
anaconda-ks.cfg Documents gobin goproject japan Pictures test
ChangeLog-2.6.0 Downloads goc2p hello.shell linux-2.6.39.tar.bz2 Public Videos
Desktop go1.8.3.linux-amd64.tar.gz golib initial-setup-ks.cfg Music Templates
[root@localhost ~]# ls && echo yes || echo no
anaconda-ks.cfg Documents gobin goproject japan Pictures test
ChangeLog-2.6.0 Downloads goc2p hello.shell linux-2.6.39.tar.bz2 Public Videos
Desktop go1.8.3.linux-amd64.tar.gz golib initial-setup-ks.cfg Music Templates
yes
[root@localhost ~]# lsre && echo yes || echo no
bash: lsre: command not found...
no
三 管道符
命令格式:
命令1|命令2
命令1的正确输出作为命令2的操作对象
四 实战
[root@localhost ~]# ls -l|more
total 89304
-rw-------. 1 root root 1579 Oct 26 2016 anaconda-ks.cfg
-rw-r--r--. 1 root root 12777 Dec 18 2003 ChangeLog-2.6.0
drwxr-xr-x. 2 root root 6 Oct 28 2016 Desktop
drwxr-xr-x. 2 root root 6 Oct 28 2016 Documents
drwxr-xr-x. 2 root root 6 Oct 28 2016 Downloads
-rw-r--r--. 1 root root 90029041 Jul 8 15:13 go1.8.3.linux-amd64.tar.gz
drwxr-xr-x. 2 root root 15 Jul 8 19:26 gobin
drwxr-xr-x. 6 root root 4096 Jul 8 18:11 goc2p
drwxr-xr-x. 4 root root 26 Jul 8 19:46 golib
drwxr-xr-x. 2 root root 6 Jul 8 18:10 goproject
-rwxr-xr-x. 1 root root 79 Jul 15 14:39 hello.shell
-rw-------. 1 root root 1627 Oct 26 2016 initial-setup-ks.cfg
drwxr-xr-x. 4 root root 29 Jul 11 21:16 japan
-rw-r--r--. 1 root root 1383989 Nov 12 2016 linux-2.6.39.tar.bz2
drwxr-xr-x. 2 root root 6 Oct 28 2016 Music
drwxr-xr-x. 2 root root 6 Oct 28 2016 Pictures
drwxr-xr-x. 2 root root 6 Oct 28 2016 Public
drwxr-xr-x. 2 root root 6 Oct 28 2016 Templates
drwxr-xr-x. 3 root root 57 Jul 15 09:18 test
drwxr-xr-x. 2 root root 6 Oct 28 2016 Videos
[root@localhost ~]# netstat -an | grep ESTABLISHED
tcp 0 0 192.168.0.106:22 192.168.0.101:35342 ESTABLISHED
[root@localhost ~]# netstat -an | grep ESTABLISHED |wc -l
1
阅读全文
0 0
- Linux中的管道符
- linux中的管道符与重定向
- Linux中的管道容量
- 【Linux】中的管道实现
- 浅谈Linux中的 管道
- Linux内核中的管道
- linux中的管道通信
- linux中的管道实现和管道
- linux中的匿名管道和命名管道
- Linux:shell中的管道命令
- Linux:shell中的管道命令
- linux中的特殊符号 (|) 管道。
- linux shell中的管道执行
- linux系统中的有名管道
- linux shell中的管道执行
- linux shell中的管道执行
- Linux Shell脚本字符串命令中的管道符处理
- Linux管道符
- shell脚本执行方式
- 命令别名和快捷方式
- 干货 | 深度学习之CNN反向传播算法详解
- springmvc文件上传
- Dduilib 判断鼠标坐标是否在控件内
- Linux中的管道符
- 音视频 IPB 关键帧
- 条形码组件Spire.Barcode 教程:在Java中扫描条形码
- Linux中的通配符
- ffmpeg安装
- Bash的历史命令
- MacOS内置的字典服务
- Linux系统运行级别
- java POI之Excel导出 ( kendoUI导出excel )