Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 427545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:35:15+00:00 2026-05-12T19:35:15+00:00

Is is possible to print the execution time of a shell command with following

  • 0

Is is possible to print the execution time of a shell command with following combination?

root@hostname:~# "command to execute" && echo "execution time"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:35:15+00:00Added an answer on May 12, 2026 at 7:35 pm

    Don’t forget that there is a difference between bash’s builtin time (which should be called by default when you do time command) and /usr/bin/time (which should require you to call it by its full path).

    The builtin time always prints to stderr, but /usr/bin/time will allow you to send time’s output to a specific file, so you do not interfere with the executed command’s stderr stream. Also, /usr/bin/time‘s format is configurable on the command line or by the environment variable TIME, whereas bash’s builtin time format is only configured by the TIMEFORMAT environment variable.

    $ time factor 1234567889234567891 # builtin
    1234567889234567891: 142662263 8653780357
    
    real    0m3.194s
    user    0m1.596s
    sys 0m0.004s
    $ /usr/bin/time factor 1234567889234567891
    1234567889234567891: 142662263 8653780357
    1.54user 0.00system 0:02.69elapsed 57%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (0major+215minor)pagefaults 0swaps
    $ /usr/bin/time -o timed factor 1234567889234567891 # log to file `timed`
    1234567889234567891: 142662263 8653780357
    $ cat timed
    1.56user 0.02system 0:02.49elapsed 63%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (0major+217minor)pagefaults 0swaps
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if it's possible to run two projects at the same time
I use a tcp socket in the following way: m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
Or, "how do Russians throw exceptions?" The definition of std::exception is: namespace std {
I am making an attempt at building 64-bit native C++ applications under Visual Studio
[Updated]: Answer inline below question I have an inspecting program and one objective is
I'm a little bit confused concerning variable updates in XQuery: On [1] it says:
Hey I was wondering... I am using the pydev with eclipse and I'm really
For example I have general code for catching json, that says - its error
I have a legacy C Linux application that I need to reuse . This
Our application has a background thread which spawns a process through System.Diagnostics.Process : Process.Start(

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.