grep

grep

1. pkg_info | grep -i foopackage?

#查系统安装了指定包没?

2. netstat -natp |grep LISTEN | grep $p_port |grep $p_name |awk ' {print $7;}'|sed 's//.

*//g' >$zbtmp 这里的".* "代表匹配斜杠"/"之后的一个或多个任意字符 ".

3. AJC Grep is very easy to use and is a vast improvement over the built in Windows search facility.

AJC Grep使用非常容易,并且在Windows搜索的基础上有很大的改进。

4. AJC Grep is a powerful file finder, text search, replace and data extraction program for Windows that lets you use regular expressions.

AJC Grep是一个Windows下功能强大的文件查找,文本搜索替换和数据提取工具,支持正则表达式。

5. txt" -exec grep -l "love" {} ;

beginner兄弟写的 find / -type f -name "*.

6. #cp `rpm -ql dhcp | grep conf.s` /etc/dhcpd.

conf //拷贝dhcp.conf文件到/etc/下面。

7. CRM114 is a small language designed to write filters in; consider it to be a version of grep with super powers.

CRM114是一种专门为写过滤器设计的小语言,可以把它当做拥有超能力的grep版本。

8. Know when grep should do the counting -- and when it should step aside.

grep 可以加上 -c 选项计算结果总数,不用透过 pipe 执行 wc。

9. grep -n . filename > filename.

out进入讨论组讨论。

10. Applications such as VI, LS, and GREP are the main targets for the Windows POSIX subsystem.

VI、LS和GREP这样的应用程序是Windows POSIX子系统的主要目标。

11. You might want to search for recently created files, or grep through the last 3 days worth of log files.

也许您想搜索最近创建的文件,或者查找近三天内的日志文件中的字符串。

12. Why geeks like computers: unzip, strip, touch, finger, grep, mount, fsck, more, yes, fsck, fsck, fsck, umount, sleep.

你丢得不久,技术还能恢复不少.我就不行啦.有空联系一下,多多交流.

13. -type f -exec grep “the string you want find...” {} ;

内容摘要: 例如查找当前目录下含有the string you want find...字符串的文件: $find .

14. Another powerful mechanism is to find all occurrences of a name in a group of files, using the :grep command.

印象中的北京气候及其恶劣,干燥、风沙大。

15. grep http://www.FeedBurner.com chedong_access_log.200601*|awk '{print $4,$6,$7,$9,$10}'

原始日志:大约30分钟左右同步一次:虽然访问频度很高,但是产生流量的只有少数的几次。

16. grep -E "str1|str2|str3" file|cut -d" "-f5 >file2

各位高手,怎样使用1个命令提取日志文件的多行记录?谢谢!!!

17. 0.0.0 | grep UG | grep $tctgw`" ];

听听听听 if [ -n "`route -n | grep 0.

18. The chkconfig command can be used with grep to determine the run levels in which sendmail will run. Here we see it will run at levels 3 and 5.

命令行工具和文档搜索工具的配合使用可以让你决定邮件服务器的运行等级.下面的命令可以让邮件服务器运行在3级和5级.

19. ps -ef |grep java |grep -v grep |awk '{print $2}' |xargs kill -9

如果一个程序有很多进程需要杀死,可以“批量杀死”,如:

20. If you're interested in the history of a particular WU or result, grep for WU#12345 or RESULT#12345 (12345 represents the ID) in the log files.

如果你对某个WU或者计算结果的历史有兴趣,请在日志文件中搜索WU#12345或RESULT#12345(12345代表编号)。

21. LINKS=(`cat /dev/shm/lrc_file | grep -i "

将所有的歌词文件的链接地址保存到一个数组里面,如果第一链接没有下载成功的话继续下载下一链接。

22. # turn off all options except the one that invoked this action$self->set($_, 0) foreach grep !

将所有这三个选项设置为 0 是可行的;

23. #uerf -R -r 300 | grep phisical ;

得到在线运行的内存容量(以M为单位).

24. dpkg -l `apt-cache depends xfce4-battery-plugin | grep Depend |awk '{print $2}'

怎么列出一个包的所有依赖软件的版本?

25. You can also use text-file sort and filter utilities (such as grep) to retrieve audit records for a particular user or utility.

您还可以使用文本文件排序和过滤实用程序(如grep)来检索特定用户或实用程序的审计记录。

26. scconf -pvv | grep dsk/d2 Device group name: dsk/d2 ...

查看原始磁盘设备组的节点列表。

27. scconf -pvv | grep dsk/d2 Device group name: dsk/d2 ... (dsk/d2) Device group node list: phys-schost-1, phys-schost-3 ...

查看原始磁盘设备组的节点列表。输出类似于以下内容。

28. rpm -qa grep wine ;

查询以前安装的Linux版本。

29. grep "/freetry/java_wappush/gamecity.jsp" access_log.0927 | grep "404 "| awk '{print $13}' | sort | uniq | awk -F" '{print $2}'

查询日志,搜索错误404记录,打印,排序,唯一性排选,取字段,去冒号集于一身:

30. grep -n " Fetch Count:" stmtevmon_output | grep -v ": 0" | sort -k 4,4rn | more findstr /C:" Fetch Count: " stmtevmon_output | findstr /V /C:" Fetch Count: 0" | sort

标识了想要进一步观察的一些元素之后,打开语句事件监视器的输出,并按您感兴趣的字符串进行搜索。一旦定位到语句,下面的一些字段将很有用:

31. Grep - search a file for a pattern

模式查找

32. if test -f $file &&test -x $file &&test -w $file ; then if grep -s echo $file >/dev/nul ; then head -n 1 $file >.mm

现在只有两个临时文件的产生了,代码也被精简到了13行.当然可以完全用;来把代码甚至写到1-2行,但这里我只是说明问题,就

33. Direct lookup reference or delete, you can use GREP to format and complex searching.

直接查找引用或删除,还可以利用GREP进行格式和复杂的搜索。

34. # vgdisplay myvg | grep Free (

看看还剩多少空间)

35. find /usr/include -exec grep -H PIPE_BUF {} ;

管道和命名管道的最大缓冲是多少?

36. etc/rc.d/rc.sysinit:line 182 78 Segmentation fault LC_ALL=C grep -iq "nousb" /proc/cmdline 2>/dev/null

系统运行到这儿的进候就停住了,真是把我给急坏了!

37. We're excited to welcome you to Grep, a new, interactive community that connects the Elastic Path development and support team with Elastic Path customers and partners.

网络信息技术的飞速发展,使生活、商业都不可缺少的一部分,然而,网站制作信息技术的深层次的使用我们还处在初级阶段!!

38. curl -s -d "username=MY_USER_NAME&password=MYPASSWORD&serviceID=0&webserviceID=0&tempID=0"http://211.160.92.162/login.cgi grep SessionID

要写在一行里,另外把服务器地址和用户名密码都换成你自己的我按照你所说的做了更改,好像没有任何作用。可能是我操作方法错了。

39. for i in `find . | xargs file | grep "directory" | cut -d ":" -f1

请教。。。。怎样统计某一目录下各子目录下的文件数??

40. find / -type f -print0 | xargs -0 grep -liwZ GUI | xargs -0 rm -f

这两种组合方式.这允许处理包含空白或引号的参数.

41. -name *.c -exec grep -w mystring {} ;

这个方法好像可以完成 find .

42. grep -n " Rows read: " stmtevmon_output | grep -v ": 0" | sort -k 4,4rn | more findstr /C:" Rows read: " stmtevmon_output | findstr /V /C:" Rows read: 0" | sort

这标识了一条语句读取的行数(没有将索引项或直接表读计算在内)。如果这个数字很大,则意味着需要一个索引,或者统计信息已过时。

43. /bin//bashmysql -u root -p -e "show processlist" | grep -i "Wait" >> locked_log.txtfor line in `cat lo...

进入mysql执行show processlist;查看当前正在执行的进程。利用以下脚本获取正在等待中的进程ID号#!

44. netstat -an --tcp | grep ":80" | grep ESTABLISHED | awk '{printf "%s %s ",$5,$6}' | sort

遇到这种问题,确实叫人纳闷.请帮忙如何解决这个问题.谢谢,我会记住你的.

英语宝典
考试词汇表