Home Error using timeout command - invalid time interval
Reply: 0

Error using timeout command - invalid time interval

user4855 Published in September 21, 2018, 8:03 am

I want to kill a command after waiting for result for 2 seconds. If the command didn't come up with a result (took too long), the command should stop. I have gone through the documents and tested the following command:

timeout --kill-after=2 ls /mnt/ftp/;
echo $?;


timeout -k 2 ls /mnt/ftp/;
echo $?;

However, I am getting this error:

timeout: invalid time interval ‘ls’

Note: The command below stops after timeout period by doesn't kill the process:

timeout 2 ls /mnt/ftp/;
share|improve this question

1 Answer 1

active oldest votes
up vote 1 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.431997 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO