How to determine the duration of execution of a particular command on Linux

Fig.01: Determine the duration of execution of a particular command on Linux with resource utilization

Fig.01: Determine the duration of execution of a particular command on Linux with resource utilization

To determine the duration of execution of a particular command on Linux with resource utilization type:
$ /usr/bin/time -v command
$ /usr/bin/time -v command arg1 arg2
## Run date command ##
$ /usr/bin/time -v date
## Run grep command ##
$ /usr/bin/time -v --color grep vivek /etc/passwd

Sample outputs:

vivek:x:1000:1000:Vivek Gite,,,:/home/vivek:/bin/bash
	Command being timed: "grep --color vivek /etc/passwd"
	User time (seconds): 0.00
	System time (seconds): 0.00
	Percent of CPU this job got: 0%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 2432
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 111
	Voluntary context switches: 1
	Involuntary context switches: 4
	Swaps: 0
	File system inputs: 0
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

In simple format you just the following information:
$ time date
Sample outputs:

Tue Dec  8 15:28:37 IST 2015
 
real	0m0.003s
user	0m0.000s
sys	0m0.000s

Please note that /usr/bin/time is an external command. The time is an internal command provided by your shell:
$ type -a time
Sample outputs:

time is a shell keyword
time is /usr/bin/time

Examples and usage: How to summarize detailed system resource usage for given command on a Linux or Unix