Linked Questions

4
votes
2answers
6k views

How to open a process from terminal without becoming child process? [duplicate]

If I execute the following command in LXTerminal: gnome-terminal & gnome-terminal gets opened. But as soon as I close the LXTerminal, gnome-terminal will be closed as well because it's a child ...
0
votes
1answer
201 views

what is the difference between starting a command with nohup and &? [duplicate]

nohub and & seem to have a similar effect on the surface, they both start processes without occupying the shell from which they have been started, how do they differ on a deeper level?
354
votes
11answers
469k views

How can I run a command which will survive terminal close?

Sometimes I want to start a process and forget about it. If I start it from the command line, like this: redshift I can't close the terminal, or it will kill the process. Can I run a command in such ...
37
votes
7answers
38k views

How can I close a terminal without killing its children (without running `screen` first)?

sometimes I run an app in the gnome-terminal, but then I suddenly have to restart gnome or something. I guess the answer to the question is also useful then I want to disconnect from SSH where ...
30
votes
4answers
25k views

When do you need 'nohup' if you're already forking using '&'?

First this question is related but definitely not the same as this very nice question: Difference between nohup, disown and & I want to understand something: when I do '&', I'm forking right?...
23
votes
7answers
16k views

Process descendants

I'm trying to build a process container. The container will trigger other programs. For example - a bash script that launches running background tasks with '&' usage. The important feature I'm ...
26
votes
4answers
88k views

pausing a bash script until previous commands are finished

I have a bash script that looks like the following: ##script #!/bin/bash rm data* rm logfile* for i in {1..30} do ## append a & if you want to run it parallel; nohup Rscript --vanilla main.R 10 ...
14
votes
4answers
49k views

Running multiple nohup commands in background

Got two commands cmd1 and cmd2. Of the two, cmd2 takes longer to finish. Need to run cmd2 and then cmd1. Tried to run them in following way: bash$ (nohup ./cmd2>result2 &) && nohup ....
9
votes
6answers
1k views

(bash) Script A, wait for script B, but not its child process

So I have scriptA which does: ssh server1 -- scriptB & ssh server2 -- scriptB & ssh server3 -- scriptB & wait otherstuffhappens ScriptB does: rsync -av /important/stuff/. remoteserver:...
19
votes
2answers
3k views

Do `disown -h` and `nohup` work effectively the same?

disown causes a shell not to send SIGHUP to its disowned job when the shell terminates, and removes the disowned job from the shell's job control. Is the first the result of the second? In other ...
12
votes
3answers
4k views

Why is chromium-browser killed when I close the terminal despite nohup?

This question is old, and I am still not clear about why. Original question in 2014: In a Gnome Terminal tab, I ran $ nohup chromium-browser & But when I close the terminal tab, chromium-...
6
votes
3answers
2k views

Why are background jobs started by my shell living longer than the parent shell and controlling terminals?

It is commonly said that "&" puts the process into background execution, but that process would be killed when terminal is closed. But from what I see, everything I sent into background was ...
10
votes
1answer
5k views

Why nohup background process is getting killed?

I tried starting a shell script via a remote session, which starts a process in the background using the command. nohup python3 run.py > nohup.out & When the remote session is closed, the ...
3
votes
4answers
2k views

How to run a process overnight on a remote server after quitting out ssh

I'm really new to linux (like earlier this week is when I started) so excuse me if this is a really simple question. I am running a program on a remote server and it's a lengthy process dealing with a ...
3
votes
2answers
6k views

How can I run a particular script every second?

I have tried using crontab, but it is limited to minutes. Is there any other option? I have also tried something like: watch -n 1 sh /path-to-script/try.sh But whenever I close the terminal it ...

15 30 50 per page