上次说了一下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 -
192.168.10.22 - - [10/oct/2005:16:53:06 +0800] 'get/icons/blank.gif http/1.1' 304 -。-k 4: 按第4个字段排序,也就是[03/apr/2002:10:30:17 +0800]具体日志格式111.222.111.222 - - [03/apr/2002:10:30:17 +0800] "get /index.html http/1.1" 200 419。注意tomcat默认使用8080端口,安装了oracle则会占用tomcat的8080linux命令,因此,可以修改tomcat端口---tomcat--e:\tomcat6.0\conf\server.xml---
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 -
date: mon aug 26 07:28:11 2013 +0800。192.168.10.22 - - [10/oct/2005:16:53:06 +0800] 'get /icons/back.gifhttp/1.1' 304 -。10.0.0.139- - [08/jun/2016:15:35:43 +0800] "get / http/1.1" 200 26 "-" "curl/7.19.7 。
0:0:0:0:0:0:0:1 - - [22/Aug/2017:16:55:26 +0800] "GET /bg-middle.png HTTP/1.1" 304 -
date: mon aug 26 07:28:11 2013 +0800。192.168.10.22 - - [10/oct/2005:16:53:06 +0800] 'get /icons/back.gifhttp/1.1' 304 -。10.0.0.139- - [08/jun/2016:15:35:43 +0800] "get / http/1.1" 200 26 "-" "curl/7.19.7 。
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
://1882.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c0528cg2.gif://1844.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c055a3g2.gif://1824.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c05c5dg2.gif。://1864.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c03c9cg85.gif://1882.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c06743g86.gif://1852.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c0690fg86.gif。://1844.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c06197g2.gif://1824.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c06645g2.gif://1864.img.pp.sohu.com.cn/images/2013/3/12/12/5/s15763919_13e20c06a6ag2.gif。
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 -
date: tue aug 20 14:53:12 2013 +0800 。date: tue aug 20 14:53:12 2013 +0800?。date: tue aug 20 14:53:12 2013 +0800。
2、*号的使用。例如:
[root@localhost bin]# ls -all | find *j*
bootstrap.jar
commons-daemon.jar
tomcat-juli.jar