如果要将输入文件的搜索扩展为包含子目录,可向命令中添加- recurse选项。
To extend the search for input files to include subdirectories, add the -recurse option to the command.
该命令将搜索整个 home 目录 (find /home/joe) 以查找所有的常规文件 (-type f) 中具有后缀 .txt 的文件,然后运行 grep 命令来搜索字符串 Monthly Report。
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.
find将搜索这些目录,而sort命令将确保按照目录的名称顺序返回相关的信息(请参见清单6)。
Find searches for directories, and sort ensures that the information is returned in directory name order (see Listing 6).
应用推荐