Linux `time` command in hour format

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Linux time command will produce the output in minute and second format.
Is it possible to change it to hour format?



[user@Linux ~]$ time ./script.sh

real 394m30.145s
user 388m20.129s
sys 16m16.255s
[user@Linux ~]$


It would be nice if the output can be formatted like this



[user@Linux ~]$ time ./script.sh

real 6 Hours 34 Minutes 30.145s
user 6 Hours 28 Minutes 20.129s
sys 16m16.255s
[user@Linux ~]$






share|improve this question
























    up vote
    0
    down vote

    favorite












    Linux time command will produce the output in minute and second format.
    Is it possible to change it to hour format?



    [user@Linux ~]$ time ./script.sh

    real 394m30.145s
    user 388m20.129s
    sys 16m16.255s
    [user@Linux ~]$


    It would be nice if the output can be formatted like this



    [user@Linux ~]$ time ./script.sh

    real 6 Hours 34 Minutes 30.145s
    user 6 Hours 28 Minutes 20.129s
    sys 16m16.255s
    [user@Linux ~]$






    share|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Linux time command will produce the output in minute and second format.
      Is it possible to change it to hour format?



      [user@Linux ~]$ time ./script.sh

      real 394m30.145s
      user 388m20.129s
      sys 16m16.255s
      [user@Linux ~]$


      It would be nice if the output can be formatted like this



      [user@Linux ~]$ time ./script.sh

      real 6 Hours 34 Minutes 30.145s
      user 6 Hours 28 Minutes 20.129s
      sys 16m16.255s
      [user@Linux ~]$






      share|improve this question












      Linux time command will produce the output in minute and second format.
      Is it possible to change it to hour format?



      [user@Linux ~]$ time ./script.sh

      real 394m30.145s
      user 388m20.129s
      sys 16m16.255s
      [user@Linux ~]$


      It would be nice if the output can be formatted like this



      [user@Linux ~]$ time ./script.sh

      real 6 Hours 34 Minutes 30.145s
      user 6 Hours 28 Minutes 20.129s
      sys 16m16.255s
      [user@Linux ~]$








      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 6 '17 at 3:34









      Charlotte Russell

      18817




      18817




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          You can use /usr/bin/time instead as I doubt if the shell time keyword has formatting options.



          /usr/bin/time -f "%E" ./script.sh





          share|improve this answer


















          • 1




            The time keyword does have formatting options, albeit very limited. See TIMEFORMAT in Bash Variables.
            – muru
            Nov 6 '17 at 3:55










          • @muru, thanks but it didn't work user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
            – Charlotte Russell
            Nov 6 '17 at 4:04






          • 1




            @CharlotteRussell that's αғsнιη's answer, and it has -f "%E". Note the -f.
            – muru
            Nov 6 '17 at 4:05










          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f402754%2flinux-time-command-in-hour-format%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          You can use /usr/bin/time instead as I doubt if the shell time keyword has formatting options.



          /usr/bin/time -f "%E" ./script.sh





          share|improve this answer


















          • 1




            The time keyword does have formatting options, albeit very limited. See TIMEFORMAT in Bash Variables.
            – muru
            Nov 6 '17 at 3:55










          • @muru, thanks but it didn't work user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
            – Charlotte Russell
            Nov 6 '17 at 4:04






          • 1




            @CharlotteRussell that's αғsнιη's answer, and it has -f "%E". Note the -f.
            – muru
            Nov 6 '17 at 4:05














          up vote
          1
          down vote













          You can use /usr/bin/time instead as I doubt if the shell time keyword has formatting options.



          /usr/bin/time -f "%E" ./script.sh





          share|improve this answer


















          • 1




            The time keyword does have formatting options, albeit very limited. See TIMEFORMAT in Bash Variables.
            – muru
            Nov 6 '17 at 3:55










          • @muru, thanks but it didn't work user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
            – Charlotte Russell
            Nov 6 '17 at 4:04






          • 1




            @CharlotteRussell that's αғsнιη's answer, and it has -f "%E". Note the -f.
            – muru
            Nov 6 '17 at 4:05












          up vote
          1
          down vote










          up vote
          1
          down vote









          You can use /usr/bin/time instead as I doubt if the shell time keyword has formatting options.



          /usr/bin/time -f "%E" ./script.sh





          share|improve this answer














          You can use /usr/bin/time instead as I doubt if the shell time keyword has formatting options.



          /usr/bin/time -f "%E" ./script.sh






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 6 '17 at 3:55









          muru

          33.6k577144




          33.6k577144










          answered Nov 6 '17 at 3:49









          αғsнιη

          15.5k92563




          15.5k92563







          • 1




            The time keyword does have formatting options, albeit very limited. See TIMEFORMAT in Bash Variables.
            – muru
            Nov 6 '17 at 3:55










          • @muru, thanks but it didn't work user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
            – Charlotte Russell
            Nov 6 '17 at 4:04






          • 1




            @CharlotteRussell that's αғsнιη's answer, and it has -f "%E". Note the -f.
            – muru
            Nov 6 '17 at 4:05












          • 1




            The time keyword does have formatting options, albeit very limited. See TIMEFORMAT in Bash Variables.
            – muru
            Nov 6 '17 at 3:55










          • @muru, thanks but it didn't work user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
            – Charlotte Russell
            Nov 6 '17 at 4:04






          • 1




            @CharlotteRussell that's αғsнιη's answer, and it has -f "%E". Note the -f.
            – muru
            Nov 6 '17 at 4:05







          1




          1




          The time keyword does have formatting options, albeit very limited. See TIMEFORMAT in Bash Variables.
          – muru
          Nov 6 '17 at 3:55




          The time keyword does have formatting options, albeit very limited. See TIMEFORMAT in Bash Variables.
          – muru
          Nov 6 '17 at 3:55












          @muru, thanks but it didn't work user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
          – Charlotte Russell
          Nov 6 '17 at 4:04




          @muru, thanks but it didn't work user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
          – Charlotte Russell
          Nov 6 '17 at 4:04




          1




          1




          @CharlotteRussell that's αғsнιη's answer, and it has -f "%E". Note the -f.
          – muru
          Nov 6 '17 at 4:05




          @CharlotteRussell that's αғsнιη's answer, and it has -f "%E". Note the -f.
          – muru
          Nov 6 '17 at 4:05

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402754%2flinux-time-command-in-hour-format%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

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

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?