TL; DR: Use type para verificar se o comando é um shell embutido. Você está usando time do bash em time xyz e /usr/bin/time em nice time xyz .
Use type <command> para saber o que seu shell usa:
$ type time
time is a shell keyword
Em bash time é uma palavra-chave do shell. Não é o comando time (que pode ser encontrado em which time ). Vários comandos têm palavras-chave de shell internas no bash, por exemplo, echo , test , pwd e outras:
$ type echo test pwd nice time
echo is a shell builtin
test is a shell builtin
pwd is a shell builtin
nice is /usr/bin/nice
time is a shell keyword
Observe que man retornará a documentação incorreta nesse caso. Você precisa de help para os comandos do shell:
$ help time
time: time [-p] pipeline
Report time consumed by pipeline's execution.
Execute PIPELINE and print a summary of the real time, user CPU time,
and system CPU time spent executing PIPELINE when it terminates.
Options:
-p print the timing summary in the portable Posix format
The value of the TIMEFORMAT variable is used as the output format.
Exit Status:
The return status is the return status of PIPELINE.
O manual do time contém uma sugestão, a propósito:
$ man time
TIME(1) General Commands Manual TIME(1)
NAME
time - run programs and summarize system resource usage
SYNOPSIS
time [ -apqvV ] [ -f FORMAT ] [ -o FILE ]
[ --append ] [ --verbose ] [ --quiet ] [ --portability ]
[ --format=FORMAT ] [ --output=FILE ] [ --version ]
[ --help ] COMMAND [ ARGS ]
DESCRIPTION
time run the program COMMAND with any given arguments ARG....
When COMMAND finishes, time displays information about
resources used by COMMAND (on the standard error output, by
default). If COMMAND exits with non-zero status, time displays
a warning message and the exit status.
...
EXAMPLES
...
Users of the bash shell need to use an explicit path in order
to run the external time command and not the shell builtin
variant. On system where time is installed in /usr/bin, the
first example would become
/usr/bin/time wc /etc/hosts
Referências:
-
man 1 time -
info bash timeouman 1 bashseção "Pipelines" em "SHELL GRAMMAR" - A linha de comandos do Linux , páginas 43-46.