Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Time format on zsh

Tags:

time

zsh

I'm trying to run the command

time -f "\t%E real,\t%U user,\t%S sys" ls -Fs

on my zsh but I get

zsh: command not found: -f

But I got this line of code from the man docs of time.

Is this an issue with zsh?

like image 586
Migore Avatar asked Mar 07 '13 01:03

Migore


2 Answers

The zsh builtin time (as you've figured out by now) doesn't take a -f option; rather, you set the value of the shell parameter TIMEFMT

$ TIMEFMT=$'\t%E real,\t%U user,\t%S sys'
$ time ls -Fs
like image 183
chepner Avatar answered Jan 04 '23 06:01

chepner


Try /usr/bin/time -f "\t%E real,\t%U user,\t%S sys" ls -Fs

I found this answer here

like image 23
S M Avatar answered Jan 04 '23 04:01

S M