Grep can find fixed sequences of characters and can even ignore case with the -i option.
grep可以查找具有固定顺序的字符组合,甚至可以通过使用- i选项来忽略大小写。
For example, a simple grep command can help you find files that match certain search criteria.
例如,一个简单的grep命令能够帮助您找到匹配特定搜索条件的文件。
Through the paintbrush example, you learned how to navigate the source tree and use grep to find to find the code that implements the features you want to modify.
通过这个画笔示例,您了解到如何导航源代码树以及使用grep来查找实现您想修改的特性的代码。
One of the best ways to find where the code for a feature you saw in the program resides is to use the grep command.
要找到您在程序中看到的某个特性的代码的驻留位置,最好的方法之一就是使用grep命令。
A coarse tool like grep will generally find a lot of things that are not of interest.
象grep这样粗糙的工具通常会找到许多没有什么意义的事物。
If you like grep, you won't find any more AIO servers.
如果您喜欢使用grep,那么您将无法找到更多的AIO服务器。
To find the SCSI device name for the CD/DVD ROM drive, use the lsscsi command to list all SCSI devices, and use grep to find cd/dvd
要查找CD/DVDROM驱动器的SCSI名字,可以使用lsscsi命令显示所有的 SCSI设备,并使用grep来查找 cd/dvd
For example, Figure 2 shows how a find, grep, and wc command might be connected via pipes to find and count all files with names that begin with lowercase a.
例如,图2说明如何通过管道连接find、grep和wc命令,从而寻找名称以小写字母 a开头的所有文件并统计其数量。
xargs consumes the filenames from find and runs grep -l repeatedly to process every file, no matter how many files are named.
xargs 接收来自find 的文件名并重复运行grep-l以处理每个文件,而不论有多少个文件。
Having the new executable, you can use the grep utility to search for main in the map file to find its address.
得到新的可执行应用程序之后,您就可以使用grep工具在映像文件中查找main来寻找它的地址了。
The command searches your entire home directory (find /home/joe) to find all regular files (-type f) with the suffix .txt, and then runs the grep command to search for the string Monthly Report.
该命令将搜索整个home目录 (find /home/joe)以查找所有的常规文件 (-typef) 中具有后缀 .txt 的文件,然后运行grep 命令来搜索字符串MonthlyReport。
The file name is missing because find called grep once for each file, and grep is smart enough to know that if you only give it one file name, then you don't need it to tell you what file it was.
缺少了文件名,因为find为每个文件调用grep一次,而 grep 非常智能,能够知道您是不是仅提供文件名,您不需要它告诉您是哪个文件。
For instance, I often use find in combination with grep or Perl to process a large number of files.
例如,我经常将find与grep或者Perl一起使用,以便对大量的文件进行处理。
Listing 5 shows a Linux system where an Apache log has accidentally been deleted, and I am using the grep tool to find out if anyone has it open.
清单5显示了一个Linux系统,其中意外地删除了Apache日志,我正使用grep工具查找是否有人打开了该文件。
You might want to try using whatis on some common useful commands like cat, more, grep, mv, find, tar, chmod, chown, date, and script.
你可能会尝试使用whatis用于像cat,more,grep,mv,find,tar,chmod,chown,date和script的常用命令。
When you run through the above, you'll find that the first four applications use the same regexp you used with grep in Listing 4, but the regexps for sed and vim are just a little different.
执行上面的步骤时,将发现前四个应用程序使用的regexp与清单4中的grep使用的完全相同,而sed和vim的regexp仅有一点差别。
Listing 2: Find all password files and grep them for Joe.
清单2:查找所有password文件并用grep找出joe。
Listing 2: Find all password files and grep them for Joe.
清单2:查找所有password文件并用grep找出joe。
应用推荐