Questions tagged [job-control]
22 questions
139
votes
8 answers
What to do when Ctrl-C won't kill running job?
Sometimes, processes ignore the SIGINT signal sent by Ctrl-C in Bash. For instance, man and vi. Assuming you don't want to google or read the manual on how to exit the running process, is there any key sequence that will always work (without leaving…
Olivier Lalonde
- 60,581
86
votes
3 answers
What should I do when I get 'There are stopped jobs' error?
I face this type of situation many times.
For example, whenever I try to open some file in emacs with sudo rights using:
sudo emacs tet.c &
Instead of asking me for the password Ubuntu just starts emacs process without any emacs window or any …
Null pointer
- 2,607
42
votes
3 answers
How can I run OpenVPN as root in the background, in a script?
I'd like to write a script that calls openvpn first, followed by ssh. When typing the command
sudo openvpn ~/my_connection.ovpn
in the command prompt I get the following output:
...
Wed Jan 4 21:04:35 2017 do_ifconfig, tt->ipv6=0,…
null
- 1,261
- 5
- 17
- 23
37
votes
3 answers
How to stop a bash while loop running in the background?
I started a while loop as follows:
while true; do {command}; sleep 180; done &
Notice the &.
I thought when I killed the terminal, this while loop would stop. But it is still going. It has been hours since I killed the terminal session.
How do I…
Saqib Ali
- 875
23
votes
1 answer
How to send a process to background and foreground?
If I do ping google.com &, the process goes into the background and keeps showing me the ping details. I can still use terminal with other commands, but the output from ping and output from other commands get mixed up (which is not a problem), but I…
posixKing
- 1,143
22
votes
3 answers
What is the meaning of & at the end of a command?
I have a startup script line:
pyprogramm >> /dev/null 2>&1 &
Meanings:
>> /dev/null - redirect stdout to null device
2>&1 - redirect stderr to stdout (that is redirected to null device)
but what does the very last & mean?
vico
- 4,717
- 23
- 66
- 89
17
votes
4 answers
How to find still running processes in a terminal?
When I try to close a tab in Gnome Terminal, it says:
Close this terminal? There is still a process running in this terminal. Closing the terminal will kill it.
How can I find out what is still running? Note that there is nothing in the output of…
Tim
- 26,107
15
votes
1 answer
How to resume terminal functionality after issuing the "suspend" command?
I typed suspend in my terminal, and it suspended the execution.
How do I get back to normal terminal functioning? I've tried Ctrl+C, Ctrl+D, Ctrl+Q (as suggested here), and Ctrl+Z, but none of these work. Of course I can close the terminal and open…
Cerberus
- 383
14
votes
2 answers
Is there a way to provide serial tasks on terminal while a task is executing (without using a file)?
Suppose there are 2 tasks t1, t2 which can be executed in a serial way as below:
t1 ; t2
# OR
t1 && t2
Now suppose I forgot to run t2 and t1 is already running; can I add t2 to the pipeline so that it gets executed after t1 finishes?
Abhimanyu Gupta
- 141
11
votes
1 answer
"respawning too fast, stopped". How to make UPSTART disable for 5 mins?
In the old days, the init daemon used to disable tasks that were respawning too fast.
I discovered to my peril that UPSTART just stops them. forever.
I have found the COUNT and INTERVAL controls for when to stop a job that is respawning fast, but I…
Keith
- 622
9
votes
2 answers
how do you background a ssh process?
I know you can suspend a ssh session with ~^z, but is there also a way to background it so that it continues working while you do something else in the local shell?
dan
- 3,123
4
votes
1 answer
Is there a way to put the foreground job in the background with a key binding?
To put the foreground job, in the background, I press cltr+Z and then bg [job-number]. Is there a way to do this in one step instead of two, with some cltr+[key] command?
And I don't mean the &. I want to put a process that I already started and am…
dan
- 3,123
3
votes
2 answers
Running grep via GNU parallel
How can I make searches with grep on a large number of files run faster? My first attempt uses parallel (which could be improved or other approaches suggested).
The first grep simply gives the list of files, which are then passed to parallel, which…
Fatipati
- 419
2
votes
1 answer
Queue manager for a laptop?
Is there a lightweight queue manager for Kubuntu? Something like torque, but as I understand it - torque works for clusters only - while I want the similar thing for my laptop.
The problem is - I'd like to start a job only if the previous jobs have…
Adobe
- 3,971
2
votes
1 answer
Command dependent on background job finishing
I am trying to run a background-job that should send an email after it terminates. The background-job can run several hours and should run independent of the Shell it was started in (because SSH will disconnect). In my current script below the mail…
Marc
- 305