如果要将输入文件的搜索扩展为包含子目录,可向命令中添加-recurse选项。
To extend the search for input files to include subdirectories, add the -recurse option to the command.
该命令将搜索整个home目录 (find /home/joe)以查找所有的常规文件 (-typef) 中具有后缀 .txt 的文件,然后运行grep 命令来搜索字符串MonthlyReport。
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).
通过使用 **/,还可以搜索子目录;该过程是递归的,例如find命令,以便您能产生 find 命令的等效结果,例如 $ find. -name "*.c"。
Subdirectories can also be searched by using **/; the process is recursive, such as the find command, so that you can produce the equivalent of a find command, such as $ find . -name "*.c".
每种Shell都有一个内置命令的分类;PATH环境变量用于指定搜索的列表和目录;而别名可以作为简写。
Each shell has an assortment of built-in commands; the PATH environment variable specifies the list and order of directories to search; and each alias ACTS as shorthand.
每种Shell都有一个内置命令的分类;PATH环境变量用于指定搜索的列表和目录;而别名可以作为简写。
Each shell has an assortment of built-in commands; the PATH environment variable specifies the list and order of directories to search; and each alias ACTS as shorthand.
应用推荐