time not accepting arguments












3















I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72.



Commands like



time --help
time --version


fail with the error "command not found". The TIME environment variable is unset. Why is time behaving like this?










share|improve this question


















  • 2





    time is a shell keyword, you probably have to point to the full path of the installed time to use it: /usr/bin/time --version or maybe alias it.

    – Jesse_b
    Jan 27 at 23:42













  • Is it possible you already have an alias for time='time -p' that would explain the portable format?

    – Jesse_b
    Jan 28 at 0:05











  • @Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p

    – Tyler Durden
    Jan 28 at 0:32











  • On my system the time builtin still has a -p option to print portable.

    – Jesse_b
    Jan 28 at 0:46
















3















I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72.



Commands like



time --help
time --version


fail with the error "command not found". The TIME environment variable is unset. Why is time behaving like this?










share|improve this question


















  • 2





    time is a shell keyword, you probably have to point to the full path of the installed time to use it: /usr/bin/time --version or maybe alias it.

    – Jesse_b
    Jan 27 at 23:42













  • Is it possible you already have an alias for time='time -p' that would explain the portable format?

    – Jesse_b
    Jan 28 at 0:05











  • @Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p

    – Tyler Durden
    Jan 28 at 0:32











  • On my system the time builtin still has a -p option to print portable.

    – Jesse_b
    Jan 28 at 0:46














3












3








3








I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72.



Commands like



time --help
time --version


fail with the error "command not found". The TIME environment variable is unset. Why is time behaving like this?










share|improve this question














I installed time but when I use it, I am getting the portable format, not the default format. When installed I think it said GNU time 1.7 or 1.72.



Commands like



time --help
time --version


fail with the error "command not found". The TIME environment variable is unset. Why is time behaving like this?







arch-linux time






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 27 at 23:39









Tyler DurdenTyler Durden

1,62542350




1,62542350








  • 2





    time is a shell keyword, you probably have to point to the full path of the installed time to use it: /usr/bin/time --version or maybe alias it.

    – Jesse_b
    Jan 27 at 23:42













  • Is it possible you already have an alias for time='time -p' that would explain the portable format?

    – Jesse_b
    Jan 28 at 0:05











  • @Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p

    – Tyler Durden
    Jan 28 at 0:32











  • On my system the time builtin still has a -p option to print portable.

    – Jesse_b
    Jan 28 at 0:46














  • 2





    time is a shell keyword, you probably have to point to the full path of the installed time to use it: /usr/bin/time --version or maybe alias it.

    – Jesse_b
    Jan 27 at 23:42













  • Is it possible you already have an alias for time='time -p' that would explain the portable format?

    – Jesse_b
    Jan 28 at 0:05











  • @Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p

    – Tyler Durden
    Jan 28 at 0:32











  • On my system the time builtin still has a -p option to print portable.

    – Jesse_b
    Jan 28 at 0:46








2




2





time is a shell keyword, you probably have to point to the full path of the installed time to use it: /usr/bin/time --version or maybe alias it.

– Jesse_b
Jan 27 at 23:42







time is a shell keyword, you probably have to point to the full path of the installed time to use it: /usr/bin/time --version or maybe alias it.

– Jesse_b
Jan 27 at 23:42















Is it possible you already have an alias for time='time -p' that would explain the portable format?

– Jesse_b
Jan 28 at 0:05





Is it possible you already have an alias for time='time -p' that would explain the portable format?

– Jesse_b
Jan 28 at 0:05













@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p

– Tyler Durden
Jan 28 at 0:32





@Jesse_b no alias. I think it is using the bash keyword 'time' which apparently is identical to time -p

– Tyler Durden
Jan 28 at 0:32













On my system the time builtin still has a -p option to print portable.

– Jesse_b
Jan 28 at 0:46





On my system the time builtin still has a -p option to print portable.

– Jesse_b
Jan 28 at 0:46










3 Answers
3






active

oldest

votes


















5














While Jesse_b is correct about how shells generally look up commands, there's an easier fix.



time --version


Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'



Also, knowing what the time builtin is, we could also get around this by running



time time --version


After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.



If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date command.






share|improve this answer































    4














    When looking for a command the shell uses the following preference:




    1. aliases

    2. Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable

    3. functions

    4. BUILTIN commands

    5. HASH table

    6. Search PATH


    So the time keyword will be used with preference over the installed version of time presumably found in your PATH. You can overcome this with an alias, such as:



    alias time=/usr/bin/time


    (ensure the path is specific to whatever location you have installed time)






    share|improve this answer

































      4














      Use:



      command builtin type time


      to see which version of time you're running.



      This is the paranoid version - usually just type time is sufficient, but the above will avoid situations where alias type=echo.



      To see all binary versions of time in your $PATH, use which -a time.






      share|improve this answer

























        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',
        autoActivateHeartbeat: false,
        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
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f497094%2ftime-not-accepting-arguments%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        5














        While Jesse_b is correct about how shells generally look up commands, there's an easier fix.



        time --version


        Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'



        Also, knowing what the time builtin is, we could also get around this by running



        time time --version


        After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.



        If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date command.






        share|improve this answer




























          5














          While Jesse_b is correct about how shells generally look up commands, there's an easier fix.



          time --version


          Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'



          Also, knowing what the time builtin is, we could also get around this by running



          time time --version


          After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.



          If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date command.






          share|improve this answer


























            5












            5








            5







            While Jesse_b is correct about how shells generally look up commands, there's an easier fix.



            time --version


            Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'



            Also, knowing what the time builtin is, we could also get around this by running



            time time --version


            After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.



            If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date command.






            share|improve this answer













            While Jesse_b is correct about how shells generally look up commands, there's an easier fix.



            time --version


            Bash, ksh, zsh, and I believe a few other common shells will treat a leading backslash on a command with no path as 'skip to looking into the PATH for this thing.'



            Also, knowing what the time builtin is, we could also get around this by running



            time time --version


            After all, the reason for the command not found error rather than a no such option error is because the shell builtin just runs the command that follows and checks how long it took to run when it finishes... which is the same thing that /bin/time does.



            If you're expecting time to take arguments... are you wanting to find out what time it is? Because that's the date command.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 28 at 3:18









            Ed GrimmEd Grimm

            3186




            3186

























                4














                When looking for a command the shell uses the following preference:




                1. aliases

                2. Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable

                3. functions

                4. BUILTIN commands

                5. HASH table

                6. Search PATH


                So the time keyword will be used with preference over the installed version of time presumably found in your PATH. You can overcome this with an alias, such as:



                alias time=/usr/bin/time


                (ensure the path is specific to whatever location you have installed time)






                share|improve this answer






























                  4














                  When looking for a command the shell uses the following preference:




                  1. aliases

                  2. Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable

                  3. functions

                  4. BUILTIN commands

                  5. HASH table

                  6. Search PATH


                  So the time keyword will be used with preference over the installed version of time presumably found in your PATH. You can overcome this with an alias, such as:



                  alias time=/usr/bin/time


                  (ensure the path is specific to whatever location you have installed time)






                  share|improve this answer




























                    4












                    4








                    4







                    When looking for a command the shell uses the following preference:




                    1. aliases

                    2. Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable

                    3. functions

                    4. BUILTIN commands

                    5. HASH table

                    6. Search PATH


                    So the time keyword will be used with preference over the installed version of time presumably found in your PATH. You can overcome this with an alias, such as:



                    alias time=/usr/bin/time


                    (ensure the path is specific to whatever location you have installed time)






                    share|improve this answer















                    When looking for a command the shell uses the following preference:




                    1. aliases

                    2. Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable

                    3. functions

                    4. BUILTIN commands

                    5. HASH table

                    6. Search PATH


                    So the time keyword will be used with preference over the installed version of time presumably found in your PATH. You can overcome this with an alias, such as:



                    alias time=/usr/bin/time


                    (ensure the path is specific to whatever location you have installed time)







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 28 at 15:04

























                    answered Jan 27 at 23:49









                    Jesse_bJesse_b

                    12.6k23066




                    12.6k23066























                        4














                        Use:



                        command builtin type time


                        to see which version of time you're running.



                        This is the paranoid version - usually just type time is sufficient, but the above will avoid situations where alias type=echo.



                        To see all binary versions of time in your $PATH, use which -a time.






                        share|improve this answer






























                          4














                          Use:



                          command builtin type time


                          to see which version of time you're running.



                          This is the paranoid version - usually just type time is sufficient, but the above will avoid situations where alias type=echo.



                          To see all binary versions of time in your $PATH, use which -a time.






                          share|improve this answer




























                            4












                            4








                            4







                            Use:



                            command builtin type time


                            to see which version of time you're running.



                            This is the paranoid version - usually just type time is sufficient, but the above will avoid situations where alias type=echo.



                            To see all binary versions of time in your $PATH, use which -a time.






                            share|improve this answer















                            Use:



                            command builtin type time


                            to see which version of time you're running.



                            This is the paranoid version - usually just type time is sufficient, but the above will avoid situations where alias type=echo.



                            To see all binary versions of time in your $PATH, use which -a time.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Jan 29 at 9:12

























                            answered Jan 28 at 3:45









                            Tom HaleTom Hale

                            6,92333694




                            6,92333694






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f497094%2ftime-not-accepting-arguments%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 change which sound is reproduced for terminal bell?

                                Can I use Tabulator js library in my java Spring + Thymeleaf project?

                                Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents