这是我打字时得到的开始 info find
find [-H] [-L] [-P] [-D DEBUGOPTIONS] [-OLEVEL] [FILE...] [EXPRESSION]
'find' searches the directory tree rooted at each file name FILE by
Run Code Online (Sandbox Code Playgroud)
评估它在树中找到的每个文件的 EXPRESSION。
我认为 [] 中的某些内容是可选的,这是否准确?还是强制性的?
以下是 find 命令的一些示例:
How can I recursively find all files in current and subfolders based on wildcard matching?
find . -name "foo*"
Run Code Online (Sandbox Code Playgroud)
以下如何适合这里:
.
-name
"foo*"
Run Code Online (Sandbox Code Playgroud)
此信息是否会查找我过时数十年的文本?
或者只是不正确?
还是我读错了?
编辑:
看到第一个答案后,我必须同意这不是表达。至少从 man 和 info 页面来看。
EXPRESSION
The part of the command line after the list of starting points is the expression. This is a
kind of query specification describing how we match files and what we do with the files that
were matched. An expression is composed of a sequence of things:
Tests Tests return a true or false value, usually on the basis of some property of a file we
are considering. The -empty test for example is true only when the current file is
empty.
Actions
Actions have side effects (such as printing something on the standard output) and
return either true or false, usually based on whether or not they are successful. The
-print action for example prints the name of the current file on the standard output.
Global options
Global options affect the operation of tests and actions specified on any part of the
command line. Global options always return true. The -depth option for example makes
find traverse the file system in a depth-first order.
Positional options
Positional optiona affect only tests or actions which follow them. Positional options
always return true. The -regextype option for example is positional, specifying the
regular expression dialect for regulat expressions occurring later on the command line.
Operators
Operators join together the other items within the expression. They include for exam?
ple -o (meaning logical OR) and -a (meaning logical AND). Where an operator is miss?
ing, -a is assumed.
If the whole expression contains no actions other than -prune or -print, -print is performed
on all files for which the whole expression is true.
The -delete action also acts like an option (since it implies -depth).
Run Code Online (Sandbox Code Playgroud)
它根本没有提到-name,-name听起来也不像Test, Action, Global Option, Positional Option or Operator。手册页甚至没有解释那些东西是什么?
这似乎是软件文档历史上最糟糕的 man / info 页面。
不,它并没有过时 - 尽管来自常规手册页(man find而不是info find)的版本可能更容易理解:
find [-H] [-L] [-P] [-D debugopts] [-Olevel] [path...] [expression]
Run Code Online (Sandbox Code Playgroud)
如果是
find . -name "foo*"
Run Code Online (Sandbox Code Playgroud)
.是路径(在信息页面中称为FILE)-name "foo*"是一个表达式其他选项[-H] [-L] [-P] [-D debugopts] [-Olevel]都是空的。
需要注意的是GNU的发现是在做既有些不寻常path和expression可选; 所以简单的命令
find
Run Code Online (Sandbox Code Playgroud)
将从当前目录开始递归查找所有文件(和目录);为了可移植性,您经常会看到人们更喜欢.像示例中那样明确指定当前目录。
| 归档时间: |
|
| 查看次数: |
186 次 |
| 最近记录: |