Linux Commands Examples

A great documentation place for Linux commands


run a command with a time limit

see also : kill



add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


DISPLAY=localhost:0 timeout 10 glxinfo
framework_failure_ "$STRACE is not available"
$TIMEOUT true > /dev/null 2>&1 ||
exec $TIMEOUT "$@"

Putty Network Error: Software caused connection abort

You need to enable TCPKeepAlive on Linux.

It's explained in PuTTy's FAQ on the web site, when you're searching for this error.


Ubuntu PPPoE connection timeout

Does it work (can you use it/surf) for those 3-4 minutes ?

I really am no ppp/pppoe expert, but this looks just twisted:

May 2 12:16:37 solomongaby-laptop pppd[7313]: local IP address
May 2 12:16:37 solomongaby-laptop pppd[7313]: remote IP address

Can you maybe try to sniff the traffic with wireshark ?

If you are really lucky, your modem offers some debugging. Mine had syslog-output, which was easily configured.


Change password timeout on Linux?

change the FAIL_DELAY line in /etc/login.defs. That should affect both login and su. But why would you want to do that ?


How can I get ping timeout below 1 second?

Found a similar question out there, and the answer was a ping alternative called fping. Maybe it'll be of some use to you.


How can I change the time before the system locks?

For Fedora 14, it is in the screensaver settings under something like "require password to return from screensaver." I don't remember the exact phrasing as I am not booted in fedora at the moment.

EDIT: I am running GNOME with Fedora 14.


How can I setup a display time switch

If you couple MultiMonitorTool with Task Scheduler you should be able to achieve your rotation. I haven't used it before but according to it's command line options it should work. A possible command from the command line could look like this:

MultiMonitorTool.exe /enable 1 /SetPrimary 1 /disable 2 3

There's also an option to move existing windows to the new primary display:


You may also want to look into the /SetNextPrimary option.

This solution is, of course, Windows only.


Timeout in whois command

I have the same thing happening and it's almost certainly because one of the central whois servers has blocked you for too many queries. I suspect it's Verisign's .com server that is being touchy as I can get names lik

I haven't yet found out a way to remove myself from the block list but am working on it and would appreciate hearing anything you find out!

To test this, try a whois of - you'll get an immediate response; then try a whois of or .net - you'll time out.

The most usual cause of getting blacklisted is too many queries from some sort of automated system. We have a whois script built into one of our helpdesk operators' tools, but it doesn't actually issue many requests so I'm rather disappointed they've seen fit to block us for what would only have been a relatively small number of queries.


Troubleshooting timeout and login problem, data transfer logging

I dug deeper, and the problem was that my router wasn't giving me the correct IP address from the DNS. Switching to OpenDNS or Google's DNS servers solved it. The sort of tool I was looking for would be wireshark, however I solved the problem before I saw wireshark.


Linux timeout if no output

It seems to me like you may want to approach the problem differently. Assuming you're connecting to the remote server via SSH, you should consider launching the process in such a way that the SSH connection can hang up normally and the process continue to execute. It would ultimately look something like:

nohup > /dev/null 2>&1 &

This uses the nohup command to execute in a way that is immune to hang-ups, redirecting STDIN/STDOUT to the discard bin (/dev/null) and then backgrounding the process. This should release the TTY used for the initial connection and allow the process to continue to run in the background even after the session (and TTY) are closed.


Start COMMAND, and kill it if still running after DURATION.

Mandatory arguments to long options are mandatory for short options too.


When not running timeout directly from a shell prompt, allow COMMAND to read from the TTY and receive TTY signals. In this mode, children of COMMAND will not be timed out.

-k, --kill-after=DURATION

also send a KILL signal if COMMAND is still running this long after the initial signal was sent.

-s, --signal=SIGNAL

specify the signal to be sent on timeout. SIGNAL may be a name like ’HUP’ or a number. See ’kill -l’ for a list of signals


display this help and exit


output version information and exit

DURATION is a floating point number with an optional suffix: ’s’ for seconds (the default), ’m’ for minutes, ’h’ for hours or ’d’ for days.

If the command times out, then exit with status 124. Otherwise, exit with the status of COMMAND. If no signal is specified, send the TERM signal upon timeout. The TERM signal kills any process that does not block or catch that signal. For other processes, it may be necessary to use the KILL (9) signal, since this signal cannot be caught. If the KILL (9) signal is sent, the exit status is 128+9 rather than 124.


Copyright © 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

reporting bugs

Report timeout bugs to bug-coreutils[:at:]gnu[:dot:]org
GNU coreutils home page: <>
General help using GNU software: <>
Report timeout translation bugs to <>


Some platforms don’t curently support timeouts beyond 2038

see also


The full documentation for timeout is maintained as a Texinfo manual. If the info and timeout programs are properly installed at your site, the command

info coreutils 'timeout invocation'

should give you access to the complete manual.


Written by Padraig Brady.

How can this site be more helpful to YOU ?

give  feedback