Track the time a command takes in UNIX/LINUX? Track the time a command takes in UNIX/LINUX? unix unix

Track the time a command takes in UNIX/LINUX?


Yes, use time <command>, such as

time ls

Consult man time for more options. Link.


Use

/usr/bin/time 

instead that the time builtin in the bash: it is more configurable AFAIK.

e.g. /usr/bin/time --format=' \n---- \nelapsed time is %e'ls


Here is how a sleep of one second looks like, timed with time:

$ time sleep 1real    0m1.001suser    0m0.000ssys 0m0.000s