Linux中的管道符ITeye - 娱乐之横扫全球

Linux中的管道符ITeye

2019年03月27日12时44分14秒 | 作者: 嘉熙 | 标签: 指令,管道,格局 | 浏览: 1383



  [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 [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 [root@localhost ~]# lsfdf echo yes bash: lsfdf: command not found... root@localhost ~]# lsfdf || echo yes bash: lsfdf: command not found... [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 [root@localhost ~]# lsre echo yes || echo no bash: lsre: command not found... 三 管道符 指令格局: 指令1|指令2 指令1的正确输出作为指令2的操作目标 [root@localhost ~]# ls -l|more total 89304 -rw-. 1 root root 1579 Oct 26 2016 anaconda-ks.cfg -rw-rr. 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-rr. 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-rr. 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
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表娱乐之横扫全球立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章