Introduction

You may need to know exactly the time it takes to execute some commands. The time command is perfect for this purpose.

This command is a bash builtin.

Examples

The last semicolon ; is important. For example:

  time { rm -rf /folder/bar && mkdir -p /folder/bar ; echo "done" ; }
  

This will give you the time taken to execute the entire block of commands as a single unit.

Last updated 19 Nov 2009, 06:45 +0200. history