A command takes a series of arguments, stdin/out/err pipes and returns an error code on completion.
time prefixes a pipeline ( the most basic case being a single command without a pipe into another ), a command block { ... } a subshell block ( ... ), a for statement, an if statement, just whatever really.
This "time" would output how long "a" took to run:
/usr/bin/time a b c | { d e ; f g ; } | h i ;
This "time" outputs how long the pipeline "a", "d", "f", and "h" took to run:
time a b c | { d e ; f g ; } | h i ;
This is a syntax error:
/usr/bin/time { d e ; f g ; }
This returns how long the command group takes to run:
Note the two /usr/bin/time's output their timing information as soon as the first command is done, but the pipeline doesn't return until both commands have exited.
time prefixes a pipeline ( the most basic case being a single command without a pipe into another ), a command block { ... } a subshell block ( ... ), a for statement, an if statement, just whatever really.
This "time" would output how long "a" took to run:
This "time" outputs how long the pipeline "a", "d", "f", and "h" took to run: This is a syntax error: This returns how long the command group takes to run: Further examples: Note the two /usr/bin/time's output their timing information as soon as the first command is done, but the pipeline doesn't return until both commands have exited.> hope this rant helps in some way