linux grep命令1.作用Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来。grep全称是Global Regular Expression Print,表示全局正则表达式版本,它的使用权限是所有用户。2.格式grep [options]...
分类:
其他好文 时间:
2014-10-28 17:07:06
阅读次数:
187
1. grep 基本语法
grep的作用就是搜索,与find不同的是:
find用于搜索目录,文件名
grep最根本上是用于检索文件内容,字符串等
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]
OPTIONS:(最常用的)
-a ...
分类:
其他好文 时间:
2014-10-28 15:32:27
阅读次数:
183
cpu信息采集cpu使用率采集算法通过/proc/stat文件采集并计算CPU总使用率或者单个核使用率。以cpu0为例,算法如下:1. cat /proc/stat | grep ‘cpu0’得到cpu0的信息2. cpuTotal1=user+nice+system+idle+iowait+irq...
分类:
系统相关 时间:
2014-10-28 13:48:11
阅读次数:
253
android sdk安装HAXM发现不能正常运行
$ kextstat | grep intel
发现无进程运行
$ sudo kextload –b com.intel.kext.intelhaxm
/Users/Frank/–b failed to load - (libkern/kext) not found; check the system/kernel logs...
分类:
移动开发 时间:
2014-10-27 22:59:19
阅读次数:
348
#!/bin/bashwhile [ 1 -eq 1 ] #一直循环doping 192.168.1.116 -c 1|grep -q "time=" #ping通有time= $?=0 不同$?=1if [ $? -eq 0 ]thenecho "tong 0" elseecho " ...
分类:
其他好文 时间:
2014-10-27 20:56:58
阅读次数:
188
Jquery遍历筛选数组的几种方法和遍历解析json对象|Map()方法详解一、Jquery遍历筛选数组1、jquery grep()筛选遍历数组$().ready( function(){ var array = [1,2,3,4,5,6,7,8,9]; var fil...
分类:
编程语言 时间:
2014-10-27 16:57:14
阅读次数:
198
[root@rac02 log]# grep "Failed password for root" /var/log/secure.1|wc -l27625[root@rac02 log]# grep "Failed password for root" /var/log/secure.2|wc -...
分类:
其他好文 时间:
2014-10-27 10:33:51
阅读次数:
205
??
一、从Map到Reduce
MapReduce其实是分治算法的一种实现,其处理过程亦和用管道命令来处理十分相似,一些简单的文本字符的处理甚至也可以使用Unix的管道命令来替代,从处理流程的角度来看大概如下:
cat input | grep | sort | uniq -c | cat > output
# Input -> Map -> Shuffle & Sort -> R...
分类:
其他好文 时间:
2014-10-26 17:06:35
阅读次数:
278
1.查看cpu个数cat /proc/cpuinfo |grep "physical id" |sort | uniq |wc -l22.查看cpu逻辑个数cat /proc/cpuinfo |grep "processor"|wc -l163.查看cpu核数cat /proc/cpuinfo |g...
分类:
系统相关 时间:
2014-10-26 13:06:47
阅读次数:
232
grep是linux中使用最广泛的命令之一,缩写来自GloballysearchaRegularExpressionandPrint,是一种强大的文本搜索工具。grep支持使用正则表达式搜索文本,根据用户指定的模式对目标文件逐行搜索并显示出能够被匹配到的行,默认将结果打印到标准输出。Linux使用的是GNU版本的grep,包..
分类:
其他好文 时间:
2014-10-25 02:06:44
阅读次数:
200