Are `-name` and `-exec` options or non-option arguments of `find`?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Are -name
and -exec
options or non-option arguments of find
? They look like short options, and they are called find expressions, if I am not mistaken. For example,
find . -name "*.txt" -exec echo ;
find arguments options
New contributor
add a comment |
up vote
0
down vote
favorite
Are -name
and -exec
options or non-option arguments of find
? They look like short options, and they are called find expressions, if I am not mistaken. For example,
find . -name "*.txt" -exec echo ;
find arguments options
New contributor
1
They're not options they're operands.
– don_crissti
Nov 20 at 22:24
Do you mean "optional"? What difference comes up in your interpretation?
– Jeff Schaller
Nov 20 at 22:27
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Are -name
and -exec
options or non-option arguments of find
? They look like short options, and they are called find expressions, if I am not mistaken. For example,
find . -name "*.txt" -exec echo ;
find arguments options
New contributor
Are -name
and -exec
options or non-option arguments of find
? They look like short options, and they are called find expressions, if I am not mistaken. For example,
find . -name "*.txt" -exec echo ;
find arguments options
find arguments options
New contributor
New contributor
edited Nov 20 at 22:29
New contributor
asked Nov 20 at 22:20
Ben
2788
2788
New contributor
New contributor
1
They're not options they're operands.
– don_crissti
Nov 20 at 22:24
Do you mean "optional"? What difference comes up in your interpretation?
– Jeff Schaller
Nov 20 at 22:27
add a comment |
1
They're not options they're operands.
– don_crissti
Nov 20 at 22:24
Do you mean "optional"? What difference comes up in your interpretation?
– Jeff Schaller
Nov 20 at 22:27
1
1
They're not options they're operands.
– don_crissti
Nov 20 at 22:24
They're not options they're operands.
– don_crissti
Nov 20 at 22:24
Do you mean "optional"? What difference comes up in your interpretation?
– Jeff Schaller
Nov 20 at 22:27
Do you mean "optional"? What difference comes up in your interpretation?
– Jeff Schaller
Nov 20 at 22:27
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
The find
command has only two options in POSIX (-H
, -L
), or five in GNU (also -P
, -D
debug_opt
, -O#
). All other arguments are not options, and thus are non-option arguments.
Notably, options to find
precede the paths, while all find expressions should follow them: find [option...] path... [expression...]
. (GNU find has some additional primaries that it also calls "options" sometimes, like -maxdepth
; they're not true options, appearing inside the expression part, but I suppose the warning messages are more comprehensible if they call them that way).
add a comment |
up vote
1
down vote
-name
, -exec
, -print
etc. are not option to the find
utility but operands. An operand is
An argument to a command that is generally used as an object supplying information to a utility necessary to complete its processing. Operands generally follow the options in a command line.
(from the POSIX definitions), i.e. a non-option that tells the utility what to do (as the file
in the command rm file
which tells rm
what file to delete).
The POSIX standard description of the find
utility calls these operands primaries and this is also what they are called on BSD systems.
In the GNU find
manual, they are called expressions and are divided into groups depending on their use:
- Tests (e.g.
-name
,-mtime
) - Actions (e.g.
-delete
,-print
) - Global options (e.g.
-maxdepth
,-depth
) - Positional options (e.g.
-follow
) - Operators (e.g.
-not
,-and
)
The POSIX standard find
only has two real options, -H
and -L
. These has to do with how symbolic links are to be handled.
The POSIX standard does not define any multi-character option or "long option" for any utility. This does no preclude implementations from adding long options though, and GNU utilities in particular are well known for adding expressive long options for extended convenience features.
Do "option" find expressions work like real options? Is that why they are called options?
– Ben
Nov 21 at 0:28
What is the difference between global options and positional options?
– Ben
Nov 21 at 0:49
tests and actions are find expressions evaluable to true or false. Are option find expressions evaluable, and if yes, also to true or false?
– Ben
Nov 21 at 1:18
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The find
command has only two options in POSIX (-H
, -L
), or five in GNU (also -P
, -D
debug_opt
, -O#
). All other arguments are not options, and thus are non-option arguments.
Notably, options to find
precede the paths, while all find expressions should follow them: find [option...] path... [expression...]
. (GNU find has some additional primaries that it also calls "options" sometimes, like -maxdepth
; they're not true options, appearing inside the expression part, but I suppose the warning messages are more comprehensible if they call them that way).
add a comment |
up vote
1
down vote
The find
command has only two options in POSIX (-H
, -L
), or five in GNU (also -P
, -D
debug_opt
, -O#
). All other arguments are not options, and thus are non-option arguments.
Notably, options to find
precede the paths, while all find expressions should follow them: find [option...] path... [expression...]
. (GNU find has some additional primaries that it also calls "options" sometimes, like -maxdepth
; they're not true options, appearing inside the expression part, but I suppose the warning messages are more comprehensible if they call them that way).
add a comment |
up vote
1
down vote
up vote
1
down vote
The find
command has only two options in POSIX (-H
, -L
), or five in GNU (also -P
, -D
debug_opt
, -O#
). All other arguments are not options, and thus are non-option arguments.
Notably, options to find
precede the paths, while all find expressions should follow them: find [option...] path... [expression...]
. (GNU find has some additional primaries that it also calls "options" sometimes, like -maxdepth
; they're not true options, appearing inside the expression part, but I suppose the warning messages are more comprehensible if they call them that way).
The find
command has only two options in POSIX (-H
, -L
), or five in GNU (also -P
, -D
debug_opt
, -O#
). All other arguments are not options, and thus are non-option arguments.
Notably, options to find
precede the paths, while all find expressions should follow them: find [option...] path... [expression...]
. (GNU find has some additional primaries that it also calls "options" sometimes, like -maxdepth
; they're not true options, appearing inside the expression part, but I suppose the warning messages are more comprehensible if they call them that way).
edited Nov 20 at 22:45
answered Nov 20 at 22:39
Michael Homer
44.8k7117156
44.8k7117156
add a comment |
add a comment |
up vote
1
down vote
-name
, -exec
, -print
etc. are not option to the find
utility but operands. An operand is
An argument to a command that is generally used as an object supplying information to a utility necessary to complete its processing. Operands generally follow the options in a command line.
(from the POSIX definitions), i.e. a non-option that tells the utility what to do (as the file
in the command rm file
which tells rm
what file to delete).
The POSIX standard description of the find
utility calls these operands primaries and this is also what they are called on BSD systems.
In the GNU find
manual, they are called expressions and are divided into groups depending on their use:
- Tests (e.g.
-name
,-mtime
) - Actions (e.g.
-delete
,-print
) - Global options (e.g.
-maxdepth
,-depth
) - Positional options (e.g.
-follow
) - Operators (e.g.
-not
,-and
)
The POSIX standard find
only has two real options, -H
and -L
. These has to do with how symbolic links are to be handled.
The POSIX standard does not define any multi-character option or "long option" for any utility. This does no preclude implementations from adding long options though, and GNU utilities in particular are well known for adding expressive long options for extended convenience features.
Do "option" find expressions work like real options? Is that why they are called options?
– Ben
Nov 21 at 0:28
What is the difference between global options and positional options?
– Ben
Nov 21 at 0:49
tests and actions are find expressions evaluable to true or false. Are option find expressions evaluable, and if yes, also to true or false?
– Ben
Nov 21 at 1:18
add a comment |
up vote
1
down vote
-name
, -exec
, -print
etc. are not option to the find
utility but operands. An operand is
An argument to a command that is generally used as an object supplying information to a utility necessary to complete its processing. Operands generally follow the options in a command line.
(from the POSIX definitions), i.e. a non-option that tells the utility what to do (as the file
in the command rm file
which tells rm
what file to delete).
The POSIX standard description of the find
utility calls these operands primaries and this is also what they are called on BSD systems.
In the GNU find
manual, they are called expressions and are divided into groups depending on their use:
- Tests (e.g.
-name
,-mtime
) - Actions (e.g.
-delete
,-print
) - Global options (e.g.
-maxdepth
,-depth
) - Positional options (e.g.
-follow
) - Operators (e.g.
-not
,-and
)
The POSIX standard find
only has two real options, -H
and -L
. These has to do with how symbolic links are to be handled.
The POSIX standard does not define any multi-character option or "long option" for any utility. This does no preclude implementations from adding long options though, and GNU utilities in particular are well known for adding expressive long options for extended convenience features.
Do "option" find expressions work like real options? Is that why they are called options?
– Ben
Nov 21 at 0:28
What is the difference between global options and positional options?
– Ben
Nov 21 at 0:49
tests and actions are find expressions evaluable to true or false. Are option find expressions evaluable, and if yes, also to true or false?
– Ben
Nov 21 at 1:18
add a comment |
up vote
1
down vote
up vote
1
down vote
-name
, -exec
, -print
etc. are not option to the find
utility but operands. An operand is
An argument to a command that is generally used as an object supplying information to a utility necessary to complete its processing. Operands generally follow the options in a command line.
(from the POSIX definitions), i.e. a non-option that tells the utility what to do (as the file
in the command rm file
which tells rm
what file to delete).
The POSIX standard description of the find
utility calls these operands primaries and this is also what they are called on BSD systems.
In the GNU find
manual, they are called expressions and are divided into groups depending on their use:
- Tests (e.g.
-name
,-mtime
) - Actions (e.g.
-delete
,-print
) - Global options (e.g.
-maxdepth
,-depth
) - Positional options (e.g.
-follow
) - Operators (e.g.
-not
,-and
)
The POSIX standard find
only has two real options, -H
and -L
. These has to do with how symbolic links are to be handled.
The POSIX standard does not define any multi-character option or "long option" for any utility. This does no preclude implementations from adding long options though, and GNU utilities in particular are well known for adding expressive long options for extended convenience features.
-name
, -exec
, -print
etc. are not option to the find
utility but operands. An operand is
An argument to a command that is generally used as an object supplying information to a utility necessary to complete its processing. Operands generally follow the options in a command line.
(from the POSIX definitions), i.e. a non-option that tells the utility what to do (as the file
in the command rm file
which tells rm
what file to delete).
The POSIX standard description of the find
utility calls these operands primaries and this is also what they are called on BSD systems.
In the GNU find
manual, they are called expressions and are divided into groups depending on their use:
- Tests (e.g.
-name
,-mtime
) - Actions (e.g.
-delete
,-print
) - Global options (e.g.
-maxdepth
,-depth
) - Positional options (e.g.
-follow
) - Operators (e.g.
-not
,-and
)
The POSIX standard find
only has two real options, -H
and -L
. These has to do with how symbolic links are to be handled.
The POSIX standard does not define any multi-character option or "long option" for any utility. This does no preclude implementations from adding long options though, and GNU utilities in particular are well known for adding expressive long options for extended convenience features.
edited Nov 20 at 22:54
answered Nov 20 at 22:38
Kusalananda
117k16220357
117k16220357
Do "option" find expressions work like real options? Is that why they are called options?
– Ben
Nov 21 at 0:28
What is the difference between global options and positional options?
– Ben
Nov 21 at 0:49
tests and actions are find expressions evaluable to true or false. Are option find expressions evaluable, and if yes, also to true or false?
– Ben
Nov 21 at 1:18
add a comment |
Do "option" find expressions work like real options? Is that why they are called options?
– Ben
Nov 21 at 0:28
What is the difference between global options and positional options?
– Ben
Nov 21 at 0:49
tests and actions are find expressions evaluable to true or false. Are option find expressions evaluable, and if yes, also to true or false?
– Ben
Nov 21 at 1:18
Do "option" find expressions work like real options? Is that why they are called options?
– Ben
Nov 21 at 0:28
Do "option" find expressions work like real options? Is that why they are called options?
– Ben
Nov 21 at 0:28
What is the difference between global options and positional options?
– Ben
Nov 21 at 0:49
What is the difference between global options and positional options?
– Ben
Nov 21 at 0:49
tests and actions are find expressions evaluable to true or false. Are option find expressions evaluable, and if yes, also to true or false?
– Ben
Nov 21 at 1:18
tests and actions are find expressions evaluable to true or false. Are option find expressions evaluable, and if yes, also to true or false?
– Ben
Nov 21 at 1:18
add a comment |
Ben is a new contributor. Be nice, and check out our Code of Conduct.
Ben is a new contributor. Be nice, and check out our Code of Conduct.
Ben is a new contributor. Be nice, and check out our Code of Conduct.
Ben is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483081%2fare-name-and-exec-options-or-non-option-arguments-of-find%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
They're not options they're operands.
– don_crissti
Nov 20 at 22:24
Do you mean "optional"? What difference comes up in your interpretation?
– Jeff Schaller
Nov 20 at 22:27