The tag has no wiki summary.

learn more… | top users | synonyms

105
votes
1answer
19k views

Difference between nohup, disown and &

What is the difference between $ nohup foo and $ foo & and $ foo & $ disown
60
votes
8answers
21k views

How can I disown a running process and associate it to a new screen shell?

I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back. One way I thought of doing that was to transfer its ownership to a screen shell, ...
19
votes
2answers
4k views

What is the difference between a job and a process?

What is the difference between a "job" and a "process"?
19
votes
4answers
3k views

What happens to the output of a process that has been disowned and lost its terminal?

If I close the virtual terminal, where some process was started, does the output just go straight to /dev/null, or can it pollute memory somehow? Can I anyhow grab the output to continue reading it at ...
16
votes
5answers
7k 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 ...
14
votes
2answers
16k views

How to suspend and bring a background process to foreground

I have a process originally running in the foreground. I suspended by Ctrl+Z, and then resume its running in the background by bg <jobid>. I wonder how to suspend a process running in the ...
9
votes
1answer
4k views

How to suspend and resume proccesses like bash does

this question is a follow-up to: How to suspend and resume proccesses I have started firefox from a bash session in gnome-terminal. The proccess tree looks like this: $ ps -e -o pid,ppid,cmd -H ...
8
votes
4answers
3k views

How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?

I'm trying to set up a shell script so that it runs background processes, and when I Ctrlc the shell script, it kills the children, then exits. The best that I've managed to come up with is this. It ...
7
votes
1answer
2k views

Non-blocking bash command

Let's say I have a bash script with the following: #!/bin/sh gedit rm *.temp When I execute it using sh ./test.sh, gedit pops-up but the rm part does not run until after I close gedit. I want the ...
6
votes
4answers
2k views

How can I move a process into the background and also silence its output?

Say I start a process in the terminal and it sends output to standard error while it runs. I want to move the process into the background and also silence it at the same time. Is there a way to do ...
6
votes
2answers
656 views

Concept of controlling terminal in Unix

Can some one please explain in an easy to understand way the concept of controlling terminal in unix and unix like systems ? Is it related to a session ? If yes, then how ?
6
votes
2answers
863 views

Is it possible to transfer a running process to your terminal? [duplicate]

Possible Duplicate: How can I pause up a running process over ssh, disown it, associate it to a new screen shell and unpause it? It is fairly easy to disown a process, or make it run ...
5
votes
2answers
861 views

How to suspend and resume proccesses

In the bash terminal I can hit Control+Z to suspend any running proccess... then I can type fg to resume the proccess. Is it possible to suspend a process if I only have it's PID? And if so, what ...
5
votes
2answers
683 views

Why jobs aren't killed at logout when executed with “> /dev/null 2>&1 &”?

When you run jobs like the example below, they're killed when you logout: $ ./job.sh & However, when you execute them as in the below example, redirecting stdout to /dev/null and stderr to ...
4
votes
1answer
250 views

why do background jobs hang depending on the size of the output?

I had some stress-testing scripts that were running in parallel and they would hang after finishing and would wait for a RETURN keystroke to exit. After investigating I discovered that it is not ...
4
votes
1answer
828 views

Why do backgrounded processes sometimes stop spontaneously?

Sometimes, some time after I've backgrounded a process with bg in bash, when I press Enter in the same shell to redisplay the prompt (just to check that I'm still in bash when some output from the ...
4
votes
2answers
382 views

What are the virtues of multitasking with traditional job control vs Tmux/Screen?

tmux and screen let you run different processes (e.g. vim, a bash script, mysql, psql, etc) in different virtual windows. But traditional Unix job control (using CTRL-z, fg, bg, and jobs) seem to give ...
4
votes
1answer
98 views

Understanding when background process gets terminated

I have a script which starts a number of background processes and if works fine when called from the cmdline. However the same script is also called during my xsession startup and additionally on ...
3
votes
3answers
164 views

Quick access to work directory of background job

Minimal effort to reproduce what I am looking for, is as follows /$ sleep 1h & [1] 6564 /$ cd ~$ jobs [1]+ Running sleep 1h & (wd: /) When I use jobs to manage my ...
3
votes
2answers
101 views

What is “Exit 2” from finished background job status?

I have an exercise to put in a file some data (*conf from some directories) and need to do this in background. I did it and I am wondering what is the meaning of output messages: [A@localhost tests]$ ...
3
votes
1answer
350 views

Background task finished notification syntax

Last night, before abandoning my computer for the evening, I started a bunch of compiler jobs so they'd be ready in the morning, using make -f alpha.mak &>alpha.out &. When I came back and ...
3
votes
3answers
1k views

How to schedule something run once using anacron?

Frequently within my scripts I schedule auxiliary tasks for later in the form: at now + 8 hours <<< "rm -f workfile.$$ >> $worklog 2>&1 " or at 11pm + $(date +%M) minutes ...
3
votes
3answers
195 views

Pipe command output to input of running/backgrounded command

In Bash 4.X It it possible to do something like: command that expects input & echo some output | %1 Where %1 represents the first backgrounded command?
3
votes
1answer
2k views

How to recover a backgrounded job from a previous shell? [duplicate]

Possible Duplicate: How can I disown a running process and associate it to a new screen shell? I launched a command that lasts a long time. I had to disconnect so I moved it in the ...
3
votes
1answer
611 views

Difference between process group and job?

What's the difference between a process group and a job? If I type pr * | lpr then is it both a process group as well a job? What exactly is the difference between a process group ID and a job ID? ...
3
votes
1answer
454 views

How do I detach a process from its parent? [duplicate]

Possible Duplicate: How can I disown a running process and associate it to a new screen shell? The problem is that the process is not a job inside of my active shell (as I've logged in from ...
2
votes
3answers
1k views

Where do background jobs go?

From gnome-terminal I know the ability to suspend a job with C-z, and then send it to the background. When I close the terminal the process does not end. Where is the job being managed from, or is it ...
2
votes
3answers
468 views

How can I turn the behavior of `gedit sOmEtHiNg & disown` into the default behavior when calling gedit from the command line?

When I gedit files from the command line, it's always locking the terminal, and I'm tired of explicitly commanding a detached process for it. I tried to alias gedit as something like gedit $* & ...
2
votes
1answer
76 views

What is the purpose of abstractions, session, session leader and process groups?

I understand from Informit article that sessions and process groups are used to terminate descendant processes on exit and send signals to related processes with job control. I believe this ...
2
votes
2answers
82 views

How to supress the display of previous job details?

When I run a process in the background the process ID gets displayed in the command prompt. For example: $ gvim 1 & [3] 9584 Now when I run another process the state of the previous one also ...
2
votes
1answer
234 views

Why doesn't an orphan process receive signals?

I have two shell scripts: launch_job.sh and sub_job.sh. If launch_job.sh uses the following method to run sub_job.sh: nohup sub_job.sh & sub_job.sh becomes an orphan, i.e. with PPID 1. I ...
2
votes
0answers
73 views

mpd daemon prematurely ending jobs

I am a little out of my depth here so bear with me. I am trying to configure mpirun and mpiexec to run software called Materials Studio on a 1 node, 2 processor, 12 core cluster. The submission scheme ...
2
votes
1answer
199 views

Can I transfer running process from dead ssh [duplicate]

Possible Duplicate: How can I disown a running process and associate it to a new screen shell? I have started (as expected) a long copy process from ssh shell (putty) which died due to ...
1
vote
2answers
300 views

What is the real-world use of the bg command?

This is the output: [USER@SERVER ~] ping localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.037 ms 64 bytes from localhost ...
1
vote
3answers
613 views

How can I kill a job that was initiated in another shell (terminal window or tab)?

If I begin a process and background it in a terminal window (say ping google.com &), I can kill it using kill %1 (assuming it is job 1). However if I open another terminal window (or tab) the ...
1
vote
3answers
264 views

How to get the Job ID? [duplicate]

As we know, the shell enables the user to run background processes using & at the command line's end. Each background process is identified by a job ID and, of course, by it's PID. When I'm ...
1
vote
4answers
57 views

how to close the jobs one by one? is there any options?

There is list of jobs running. pdf is opened image is opened text file opened It's all in fg/bg . Is there any option to close the particular job forcefully? Also, I want to know if the jobs can ...
1
vote
3answers
1k views

Bash wait for jobs and limit job count [duplicate]

Possible Duplicate: Four tasks in parallel… how do I do that? Suppose a loop invoking a command grep -v '#' < files.m3u | sed 's/\\\\/\/\//g' | sed 's/\\/\//g' | while read line ...
1
vote
1answer
86 views

fg a bg process because you forgot to redirect output to /dev/null

I did Ctrl+Z bg with the intention of disowning next, but I forgot to redirect, now I cant get to my terminal because the scrolling of the output (tarballed a huge directory with verbose set). How do ...
1
vote
2answers
559 views

Basic job control: stop a job, add a job onto the stack, and `fg`

Job control is probably my favorite thing about Linux. I find myself, often, starting a computationally demanding process that basically renders a computer unusable for up to days at a time, and being ...
1
vote
2answers
389 views

How to Kill Difficult Task in Mac Terminal

I ran this grep: grep -r "\-\-\-foo\-\-\-" * | grep -vi bar For the past 5 minutes my Mac has been running hot (I can hear the fan) and I can't hit Ctrlz or x or c to kill the current task. Even ...
1
vote
1answer
129 views

Is it possible to disconnect a GUI program launched within vifm from vifm?

One can launch GUI programs, for example, gv or xpdf from vifm in background in vifm's command line: :!gv %f & However, if gv is launched by pressing Enter on a file like aPSfile.ps in vifm, ...
1
vote
1answer
783 views

ant script stops, waiting for input when run in background

I'm running an ant (Java build tool) script on CentOS 5.5 that execs another java process. When I run the ant script in the background: ant -f myfile.xml &> foo.out & The forked process' ...
1
vote
1answer
153 views

Application in terminal still running but not directly accessible [duplicate]

Possible Duplicate: How to suspend and bring a background process to foreground I have kind of an odd problem which I haven't encountered before. Here's what I did: I started an ...
0
votes
1answer
52 views

Stop tailing log

I have a problem, I accidentally did tail -f on a log, but now I cant quit! - Its the anaconda log during a redhat install. Control-C doesn't seem to work, I guess due to it saying sh: no job control ...
0
votes
1answer
218 views

How to make a scheduled task based on a file creation time?

The supercomputer I run my Analysis uses SGE to do the job management and requires each job duration not longer than 24 hours. And this feature is causing me quite a headache. Sadly, I was asked to ...
0
votes
1answer
49 views

When executing a command, it is automatically suspended

The problem happened on one of my local machines with CentOS 6. I ssh to it from my MacBook trying to test a script, which is in /usr/local/bin. However, whenever I tried to execute the command, it is ...
0
votes
0answers
121 views

Job IDs and their meaning/reference

Using Red Hat, I sent few jobs to a cluster and got "job IDs" in return. Using qstat I can see only one is running, one was canceled and the rest are still in the queue. I wrote something like this: ...
0
votes
1answer
487 views

safely killing a background process

I'm writing data to a pipe in a parent process. The parent process creates a background job that reads data from the pipe & write it to the screen & to a log file. How can I know when to kill ...