awk工作原理 第一步:执行BEGIN{action;...}语句块中的语句。 第二步:从文件或标准输入(stdin)读取一行,然后执行pattern{action;...}语句块,它逐行扫描文件,从第一行到最后一行重复这个过程,直到文件全部被读取完毕。 第三步:当读至输入流末尾时,执行END{ac ...
分类:
其他好文 时间:
2020-05-17 17:36:16
阅读次数:
70
linux下使用awk命令按时间段筛选日志 zcat com.log20160529.gz | grep 'dianping_reply'| awk '{split($4,array,"[");if(array[2]>="29/May/2016:00:00:26" && array[2]<="29/ ...
分类:
系统相关 时间:
2020-05-17 10:31:06
阅读次数:
251
history | awk '{print $1"\t"$2}' | clickhouse-client \ --query="SELECT shell, count() AS c FROM history \ GROUP BY shell ORDER BY c DESC limit 10 " \ ...
分类:
数据库 时间:
2020-05-16 20:49:03
阅读次数:
92
shell 脚本 clock.sh 保存在 目录下 由于把该脚本制作成快捷方式启动,所以牺牲了灵活性,默认45分钟 bash !/bin/bash 再次启动的时候,关闭上次启动的【提示图片】进程 kill 默认45分钟 time1=${time: 45} 如果到点后仍意犹未尽,那么5分钟后全屏提示 ...
分类:
系统相关 时间:
2020-05-16 20:36:13
阅读次数:
98
## Linux 目录- /:根目录,一般只存放目录,不存放文件- /bin -> /usr/bin:可执行二进制文件的目录,也是常用命令目录,如常用的命令 ls、cat、mv 等- /boot:该目录中存放系统的内核文件,系统引导时使用的各种文件- /dev:存放 linux 系统中所有设备的目录 ...
分类:
系统相关 时间:
2020-05-16 19:04:30
阅读次数:
74
压缩文件 zip -q -r [压缩后的文件路径或者目录文件名称] [需要被压缩的文件或者文件目录] 移动文件 mv [源文件] [目的目录文件路径] ...
分类:
系统相关 时间:
2020-05-15 13:10:48
阅读次数:
76
Unix does not have a command specifically for renaming files. Instead, the mv command is used both to change the name of a file and to move a file int ...
分类:
其他好文 时间:
2020-05-15 09:41:05
阅读次数:
60
先上脚本文件 #!/bin/bash #check MySQL_Slave Status #crontab time 00:10 MYSQLIP=`ifconfig eth0|grep "inet addr" | awk -F[:" "]+ '{print $4}'` STATUS=$(mysql ...
分类:
数据库 时间:
2020-05-14 19:03:06
阅读次数:
72
转自:https://blog.51cto.com/5iqiong/633186 收藏一些关于awk常用的案例 awk -F":" '{if($1~/root/) print $1}' /etc/passwd 打印包含root的行awk -F":" '/root/{print $1}' /etc/p ...
分类:
其他好文 时间:
2020-05-14 15:14:27
阅读次数:
53
这里总结一下linux的基本命令一、cd/ls/pwd----------------------------------------------------------二、rm/touch/mkdir/mv/cp/三、cat/more/less/head/tail四、witch/whereis/locate/find
分类:
系统相关 时间:
2020-05-14 01:57:56
阅读次数:
86