Is there an easy way to let a specific command (only terminable through Ctrl-C) run for 5 minutes automatically?  For example:  minute-command 5-minutes ping www.google.com   or any other command that does not terminate itself.  I'd like to be able to specify a time limit, not only 5 minutes.
122285
I want to limit the time a grep process command is allowed to run or be alive.  For example. I want to perform the following:  grep -qsRw -m1 "parameter" /var   But before running the grep command I want to limit how long the grep process is to live, say no longer than 30 seconds.  How do I do this?  And if it can, how do I return or reset to have no time limit afterwards.
9593
I set a command block to /tp. It was supposed to activate only if you had 0 time left, and to activate the command block with a hopper clock to keep giving it power.   But it is not checking if you have 0 time left, so it keeps teleporting me. I can't get close enough to the command block to break it, so I'm stuck in a neverending teleport loop.  Any ideas?
72625
Just this - How do you add a timer to a C# console application? It would be great if you could supply some example coding.
34339
I'd like to have a desktop notification whenever a command that has run for more than, say 15 seconds, finishes in an interactive shell.  In other words, I would like all commands to be wrapped in something like this  start=$(date +%s); ORIGINAL_COMMAND; [ $(($(date +%s) - start)) -le 15 ] || notify-send "Long running command finished"   What's the best way to accomplish this in bash?
77385
What is the -w (deadline) flag in ping for? I cannot find a description of it in the ping man page; only for -W, which takes seconds as a parameter. What is the difference between them, and how can I set a ping timeout (if host is not responding) to 200ms?
37827
Is it possible to automate the key press of a key (such as "a" or "&lt;") in Mozilla Firefox, Google Chrome or Safari (in this order)? I'd like to automate the key press of "a" for example in Mozilla Firefox for 100 times every x seconds. With x being a value between 1 second and 10 seconds chosen randomly at every key press. What Applescript could make the trick?  Also, where can I find a list of all codes for each key of the keyboard?
44991
I am trying to make a timer in Bash which countdowns 20 minutes and then starts a 10 minute break immediately after the previous. Then the loop  continues and returns again to 20 minutes.   #!/bin/bash MIN=20 BREAK=10 while [[ 0 -ne $MIN ]]; do     echo "$MIN"     sleep 1     MIN=$[$MIN-1] done WHILE [[ 0 -ne $BREAK ]]; do     echo "$BREAK"     sleep 1     BREAK=$[$BREAK-1] done   I made it with seconds here. So 20 seconds pass by and then the 10 seconds start immediately. But when the 10 seconds expire the script stops. Is there a way to start again with 20 minutes?  Thank you!
10701
I am looking for a way to execute some console commands automatically when a command-prompt is opened in Windows, specifically to set some command aliases.  For example, when a command-prompt is opened, I want a command such as the following to be automatically run so that I can use ls instead of dir.  doskey ls=dir   How can this be done?
107046
Is there a way or a 3rd party application which would let me specify, for example, that I want it to send a keyboard event (so that it has the same effect as physically hitting the key on the keyboard) every 5 seconds?  So, for example, I could tell it to hit K every 5 seconds, 15 times in total?  Basically, I'm looking for something like  but for OS X.
55610
I use terminal for almost all tasks. Let's say I have entered a huge command like this:  sudo a-huge-command   What is the easiest way to delete the whole command with a single shortcut, rather than keep on hitting backspace key?  I'm a Ubuntu newbie looking to use Ubuntu in a professional way.
25849
Can anyone tell me the difference between ctrl+z and ctrl+c?  When I am in the terminal, both the combinations stop the current process, but what exactly is the difference between both?
116894
I want to run a command before and after every single command that gets executed in a terminal (i.e. clear before and then reset). I want this to happen automatically and not with a short alias or similar.  I have looked into bashrc and /usr/share/bash-completion/bash_completion although the latter seems to be just for the auto completion feature with the Tab?   Where should I make my changes?
12192
By typing a manually specified command in terminal I want to execute some other command.  How could add an alias to a command? Can i do that with the help of the terminal or should I edit some kind of file?
91395
I have an .sh script. I would like to wait 25 minutes and then continue running, NOT repeat. It's something like this:  #!/bin/bash /bin/bash ~/path/script.sh   I want it to kill a process after waiting 25 minutes.  #Wait 25 minutes killall process
3740
I found 11 questions like this on gamingSE already, but none of them have proper and up-to-date answers. So I'm creating this Q&amp;A:  How do you either activate a command x seconds/minutes/hours/… in the future or every x seconds/minutes/… in a loop?  Repeating command blocks and ticking functions execute 20 times per second, redstone is  in many situations and most of the extremely fancy solutions, like falling blocks in cobwebs, have broken over time or are needlessly complicated.
6876
Can I use below code to set cron job for every 5 hours?   0 */5 * * * script.sh   What time my script.sh will be executed?   0000, 0500, 1000, 1500, 2000, 0100, 0600, 1100, 1600, 2100 and so on...    OR   0000, 0500, 1000, 1500, 2000, 0000, 0500, 1000, 1500, 2000 and so on...   If we can not set cron job for every 5 hours with this traditional method, is there any other way to set such job?
79347
I want to create a shortcut for a command in terminal. Like for a command  "ssh user@123.45.7.123", I just want a command "user" and the above command will run. Is this possible, and if so how can it be done?  Thank you!