Loading [MathJax]/jax/element/mml/optable/BasicLatin.js

随笔分类 -  Shell

Communicate with kernel...
摘要:有文本文件,内容如下,需要找出response不为on的设备ip root@dev[15:49:33]$ cat result.txt index[8] ip[8.8.8.8] send response[ % Total % Received % Xferd Average Speed Time 阅读全文
posted @ 2020-12-28 15:56 RainingInMacondo 阅读(1716) 评论(0) 推荐(0) 编辑
摘要:摘自这里 /sys/class/net/network-interface/statistics root@Dev[09:41:51]$ ll /sys/class/net/eth0/statistics total 0 -r--r--r-- 1 root root 4096 Jun 29 14:5 阅读全文
posted @ 2020-06-30 09:55 RainingInMacondo 阅读(325) 评论(0) 推荐(0) 编辑
摘要:1. 文件去重 sort file |uniq sort -n file |uniq 2. 文件按某一列去重 # 按照第二列去重 root@solitude[20:28:32]$ cat file beijing::198 shanghai::87 shenzhen::87 beijing::100 阅读全文
posted @ 2020-02-10 20:35 RainingInMacondo 阅读(380) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash tput civis while [ 1 ] do tput clear # tput cup 10 20 info=(date "+%Y-%m-%d %H:%M:%S %A") LEN=`echo info | wc -c` COLS=`tput cols` let HOLD_COL=COLS-LEN ... 阅读全文
posted @ 2018-08-14 11:10 RainingInMacondo 阅读(196) 评论(0) 推荐(0) 编辑
摘要:crontab shell 阅读全文
posted @ 2018-03-05 11:09 RainingInMacondo 阅读(251) 评论(0) 推荐(0) 编辑
摘要:查看swap被占用的情况 使用: 查看指定进程的swap占用情况 使用: 阅读全文
posted @ 2018-01-26 17:11 RainingInMacondo 阅读(2278) 评论(0) 推荐(0) 编辑
摘要:root@standby[16:38:35] root@standby[16:38:35] cat tmp.log qq [8.8.8.8] 6.6.6.6 [1502301436.016] "GET / HTTP/1.1" 200 21 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like ... 阅读全文
posted @ 2018-01-22 16:41 RainingInMacondo 阅读(4020) 评论(0) 推荐(0) 编辑
摘要:2018-01-03@中关村 有文本 a.log 如下,请做词频统计,统计出每个单词出现的频率并倒序排序。 方法一 - 首先通过egrep把文本内容拆成每行列出一个单词 - egrep -o 表示只打印匹配到的字符,由换行符分割 - \b 是正则表达式里的单词边界符 - [:alpha:] 是表示字 阅读全文
posted @ 2018-01-18 15:48 RainingInMacondo 阅读(2713) 评论(0) 推荐(0) 编辑
摘要:获取本机私网地址(1个) 获取本机公网地址(1个或多个) 阅读全文
posted @ 2017-05-18 14:02 RainingInMacondo 阅读(1772) 评论(0) 推荐(0) 编辑
摘要:1 #!/bin/bash 2 # Author : standby 3 # Date : 2017-05-12 4 # Description : Deploy something. 5 6 . /etc/init.d/functions 7 8 # Usage... 9 function Usage() 10 { 11 ech... 阅读全文
posted @ 2017-05-12 22:54 RainingInMacondo 阅读(200) 评论(0) 推荐(0) 编辑
摘要:1 #!/bin/bash 2 # chkconfig: 2345 40 98 3 # description: Start/Stop Nginx server 4 5 path=/application/nginx/sbin 6 pid=/application/nginx/logs/nginx.pid 7 RETVAL=0 8 9 . /etc/init.d/funct... 阅读全文
posted @ 2017-05-11 23:56 RainingInMacondo 阅读(395) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash # Author : standby@gmail.com # Date : 2018-02-27 NGX_CONF="/usr/local/nginx/conf/nginx.conf" # Get the dev which contains ./liveroot/ function get_point() { arr=(`df ... 阅读全文
posted @ 2017-05-11 23:49 RainingInMacondo 阅读(279) 评论(0) 推荐(0) 编辑
摘要:Shell + crontab 实现日志压缩归档 crontab shell 阅读全文
posted @ 2017-05-01 13:27 RainingInMacondo 阅读(981) 评论(0) 推荐(0) 编辑
摘要:Shell结合Expect自动输入密码示例 阅读全文
posted @ 2017-05-01 13:19 RainingInMacondo 阅读(625) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示