Linux `time` command in hour format
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Linux time
command will produce the output in minute and second format.
Is it possible to change it to hour format?
[user@Linux ~]$ time ./script.sh
real 394m30.145s
user 388m20.129s
sys 16m16.255s
[user@Linux ~]$
It would be nice if the output can be formatted like this
[user@Linux ~]$ time ./script.sh
real 6 Hours 34 Minutes 30.145s
user 6 Hours 28 Minutes 20.129s
sys 16m16.255s
[user@Linux ~]$
linux time
add a comment |Â
up vote
0
down vote
favorite
Linux time
command will produce the output in minute and second format.
Is it possible to change it to hour format?
[user@Linux ~]$ time ./script.sh
real 394m30.145s
user 388m20.129s
sys 16m16.255s
[user@Linux ~]$
It would be nice if the output can be formatted like this
[user@Linux ~]$ time ./script.sh
real 6 Hours 34 Minutes 30.145s
user 6 Hours 28 Minutes 20.129s
sys 16m16.255s
[user@Linux ~]$
linux time
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Linux time
command will produce the output in minute and second format.
Is it possible to change it to hour format?
[user@Linux ~]$ time ./script.sh
real 394m30.145s
user 388m20.129s
sys 16m16.255s
[user@Linux ~]$
It would be nice if the output can be formatted like this
[user@Linux ~]$ time ./script.sh
real 6 Hours 34 Minutes 30.145s
user 6 Hours 28 Minutes 20.129s
sys 16m16.255s
[user@Linux ~]$
linux time
Linux time
command will produce the output in minute and second format.
Is it possible to change it to hour format?
[user@Linux ~]$ time ./script.sh
real 394m30.145s
user 388m20.129s
sys 16m16.255s
[user@Linux ~]$
It would be nice if the output can be formatted like this
[user@Linux ~]$ time ./script.sh
real 6 Hours 34 Minutes 30.145s
user 6 Hours 28 Minutes 20.129s
sys 16m16.255s
[user@Linux ~]$
linux time
asked Nov 6 '17 at 3:34
Charlotte Russell
18817
18817
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
You can use /usr/bin/time
instead as I doubt if the shell time
keyword has formatting options.
/usr/bin/time -f "%E" ./script.sh
1
Thetime
keyword does have formatting options, albeit very limited. SeeTIMEFORMAT
in Bash Variables.
â muru
Nov 6 '17 at 3:55
@muru, thanks but it didn't workuser@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
â Charlotte Russell
Nov 6 '17 at 4:04
1
@CharlotteRussell that's ñÃÂsýù÷'s answer, and it has-f "%E"
. Note the-f
.
â muru
Nov 6 '17 at 4:05
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You can use /usr/bin/time
instead as I doubt if the shell time
keyword has formatting options.
/usr/bin/time -f "%E" ./script.sh
1
Thetime
keyword does have formatting options, albeit very limited. SeeTIMEFORMAT
in Bash Variables.
â muru
Nov 6 '17 at 3:55
@muru, thanks but it didn't workuser@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
â Charlotte Russell
Nov 6 '17 at 4:04
1
@CharlotteRussell that's ñÃÂsýù÷'s answer, and it has-f "%E"
. Note the-f
.
â muru
Nov 6 '17 at 4:05
add a comment |Â
up vote
1
down vote
You can use /usr/bin/time
instead as I doubt if the shell time
keyword has formatting options.
/usr/bin/time -f "%E" ./script.sh
1
Thetime
keyword does have formatting options, albeit very limited. SeeTIMEFORMAT
in Bash Variables.
â muru
Nov 6 '17 at 3:55
@muru, thanks but it didn't workuser@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
â Charlotte Russell
Nov 6 '17 at 4:04
1
@CharlotteRussell that's ñÃÂsýù÷'s answer, and it has-f "%E"
. Note the-f
.
â muru
Nov 6 '17 at 4:05
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can use /usr/bin/time
instead as I doubt if the shell time
keyword has formatting options.
/usr/bin/time -f "%E" ./script.sh
You can use /usr/bin/time
instead as I doubt if the shell time
keyword has formatting options.
/usr/bin/time -f "%E" ./script.sh
edited Nov 6 '17 at 3:55
muru
33.6k577144
33.6k577144
answered Nov 6 '17 at 3:49
ñÃÂsýù÷
15.5k92563
15.5k92563
1
Thetime
keyword does have formatting options, albeit very limited. SeeTIMEFORMAT
in Bash Variables.
â muru
Nov 6 '17 at 3:55
@muru, thanks but it didn't workuser@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
â Charlotte Russell
Nov 6 '17 at 4:04
1
@CharlotteRussell that's ñÃÂsýù÷'s answer, and it has-f "%E"
. Note the-f
.
â muru
Nov 6 '17 at 4:05
add a comment |Â
1
Thetime
keyword does have formatting options, albeit very limited. SeeTIMEFORMAT
in Bash Variables.
â muru
Nov 6 '17 at 3:55
@muru, thanks but it didn't workuser@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
â Charlotte Russell
Nov 6 '17 at 4:04
1
@CharlotteRussell that's ñÃÂsýù÷'s answer, and it has-f "%E"
. Note the-f
.
â muru
Nov 6 '17 at 4:05
1
1
The
time
keyword does have formatting options, albeit very limited. See TIMEFORMAT
in Bash Variables.â muru
Nov 6 '17 at 3:55
The
time
keyword does have formatting options, albeit very limited. See TIMEFORMAT
in Bash Variables.â muru
Nov 6 '17 at 3:55
@muru, thanks but it didn't work
user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
â Charlotte Russell
Nov 6 '17 at 4:04
@muru, thanks but it didn't work
user@Linux:~$ /usr/bin/time "%E%" ./script.sh /usr/bin/time: cannot run %E%: No such file or directory Command exited with non-zero status 127 0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 1184maxresident)k 0inputs+0outputs (0major+27minor)pagefaults 0swaps user@Linux:~$
â Charlotte Russell
Nov 6 '17 at 4:04
1
1
@CharlotteRussell that's ñÃÂsýù÷'s answer, and it has
-f "%E"
. Note the -f
.â muru
Nov 6 '17 at 4:05
@CharlotteRussell that's ñÃÂsýù÷'s answer, and it has
-f "%E"
. Note the -f
.â muru
Nov 6 '17 at 4:05
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402754%2flinux-time-command-in-hour-format%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password