Are `-name` and `-exec` options or non-option arguments of `find`?

The name of the pictureThe name of the pictureThe name of the pictureClash 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 ;









share|improve this question









New contributor




Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 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














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 ;









share|improve this question









New contributor




Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 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












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 ;









share|improve this question









New contributor




Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor




Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 20 at 22:29





















New contributor




Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 20 at 22:20









Ben

2788




2788




New contributor




Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 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




    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










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, -Ddebug_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).






share|improve this answer





























    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.






    share|improve this answer






















    • 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










    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Ben is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    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

























    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, -Ddebug_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).






    share|improve this answer


























      up vote
      1
      down vote













      The find command has only two options in POSIX (-H, -L), or five in GNU (also -P, -Ddebug_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).






      share|improve this answer
























        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, -Ddebug_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).






        share|improve this answer














        The find command has only two options in POSIX (-H, -L), or five in GNU (also -P, -Ddebug_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).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 20 at 22:45

























        answered Nov 20 at 22:39









        Michael Homer

        44.8k7117156




        44.8k7117156






















            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.






            share|improve this answer






















            • 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














            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.






            share|improve this answer






















            • 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












            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.






            share|improve this answer














            -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.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            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
















            • 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










            Ben is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            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.













             


            draft saved


            draft discarded














            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





















































            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






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay