1. 程式人生 > >linux命令巢狀例項(二)

linux命令巢狀例項(二)

上次說了一下linux檔案操作的命令巢狀,這次來補充一點內容。

1、!號的使用。例如:

 cat /home/i/桌面/apache-tomcat-9/logs/localhost_access_log.2017-08-22.txt  | grep [!3]
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:25 +0800] "GET /tomcat.css HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:25 +0800] "GET /tomcat.png HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:26 +0800] "GET /favicon.ico HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:26 +0800] "GET /asf-logo-wide.svg HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:26 +0800] "GET /bg-upper.png HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:26 +0800] "GET /bg-nav.png HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:26 +0800] "GET /bg-middle.png HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:26 +0800] "GET /bg-button.png HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:17:21:24 +0800] "GET /docs/images/fix.gif HTTP/1.1" 200 345
0:0:0:0:0:0:0:1 - - [22/Aug/2017:17:21:24 +0800] "GET /docs/images/add.gif HTTP/1.1" 200 1037
0:0:0:0:0:0:0:1 - - [22/Aug/2017:17:21:24 +0800] "GET /docs/images/code.gif HTTP/1.1" 200 394
0:0:0:0:0:0:0:1 - - [22/Aug/2017:17:21:24 +0800] "GET /docs/images/tomcat.gif HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [22/Aug/2017:17:21:25 +0800] "GET /docs/images/asf-logo.svg HTTP/1.1" 304

2、*號的使用。例如:

[root@localhost bin]# ls -all | find  *j*
bootstrap.jar
commons-daemon.jar
tomcat-juli.jar