The tag has no wiki summary.

learn more… | top users | synonyms

74
votes
8answers
32k 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, ...
146
votes
2answers
29k views

Difference between nohup, disown and &

What is the difference between $ nohup foo and $ foo & and $ foo & $ disown
1
vote
0answers
23 views

redirecting output of running background job in bash

in bash I have some jobs running, in background. They are always producing random irrelevant error messages that pollute the terminal. I am not always so prompt to start them with the 2>&1 > ...
5
votes
4answers
350 views

When I run `./command.sh &` the background task is suspended. How can I keep it running?

This is what I'm running: alexandma@ALEXANDMA-1-MBP ./command.sh & [2] 30374 alexandma@ALEXANDMA-1-MBP [2] + suspended (tty output) ./command.sh I don't want it suspended to start, I want it ...
2
votes
3answers
124 views

Running a timed background job in bash

I would like to execute a command in bash every 30 seconds and have it run as a background job. Form this post, I gather that using the watch command is useful. However every time I attempt to ...
26
votes
3answers
36k 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 ...
1
vote
1answer
23 views

Replacement queue now that batch doesn't accept input files?

Background I work at a research institute, and have for a long time used the batch command to submit job queues to our machines. However, a recent update changed the batch command to be ...
1
vote
1answer
69 views

Start a background process from a script and manage it when the script ends

I'd like to run and configure a process similarly to a daemon from a script. My shell is zsh emulated under Cygwin and the daemon is SFK, a basic FTP server. For what matters here, the script ...
1
vote
1answer
123 views

Running commands after ampersand symbol & in a remote ssh session

I have a shell script that initiates a long, resource-intensive command on several different machines. In order to execute the script on each machine in parallel, I have an ampersand symbol after ...
1
vote
1answer
33 views

Run program while computer is cool

I'm trying to compile a program on a computer with inadequate cooling. The program, specifically, is the linux-ck kernel with -mtune=native march=native processor-specific optimizations, so simply ...
4
votes
3answers
182 views

Get PID of any command in backgrounded piped sequence of commands

If, in bash, I execute: cmd1 | cmd2 | ... | cmdi | ... | cmdn & where the cmd{1..n} may not be distinct, how do I get the PID of cmdi? Alternatively, how can I signal the cmdi process? (For ...
0
votes
2answers
65 views

How to know when a job in screen finishes?

Is it possible to know if a script executed inside a screen session finished or not? The script can be seen by typing jobs and I would like to terminate the screen session when the script is finished. ...
3
votes
2answers
96 views

What would stop a task from being run in the background?

I have a script I'm trying to launch with php ./Script.php & The task goes into the background but it is stopped. When I try to run it with bg it simply stays stopped. $ jobs [1]+ Stopped ...
4
votes
4answers
521 views

disabling job control in bash (CTRL-Z)

It happens to me sometimes, that I press CTRL+Z by accident and my application disappears into background. I know, I can bring it back with fg, so it's not such a big deal. But I am wondering about ...
0
votes
0answers
16 views

How to cancel my job [duplicate]

I'm a beginner about LINUX in korea and English is too. I'm circulating some simulation by using the LINUX cluster but I have some problem in my job. I want to cancel any job (ID : 750, 752, 753 ...
0
votes
1answer
19 views

Starting up and keeping up a process

I am having an Ubuntu box on which I am having a Haskell process (think of it as a random server process) that I built. I want to start it on boot and restart it in case it fails for whatever reason ...
0
votes
1answer
32 views

How to dynamically chose PBS queue during job submission

I run a lot of small computing jobs in remote cluster where job submission is managed by PBS. Normally in a PBS (bash) script I specify the queue that I would like to submit the job through the ...
10
votes
1answer
7k views

How to suspend and resume processes like bash does

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

How to suspend and resume processes

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

ctrl c vs. ctrl z with foreground job

Ctrl+Z stops the job whereas Ctrl+C kills the job. Why is that? Wouldn't the other way make more sense? z@z-lap:~$ sleep 100& [1] 4458 z@z-lap:~$ sleep 200& [2] 4459 z@z-lap:~$ jobs [1]- ...
1
vote
1answer
58 views

Submitting jobs with sequential completion

If I have numerous jobs that rely on environment variables, how can I submit them sequentially? Here is my attempt that has not been working, week 6 is always submitted (and finishes) before week 5. ...
0
votes
2answers
77 views

UNIX: Submit job only after previous job completes?

I would like to submit the same .sas job iterating over an argument, but I would like job only to be submitted after the previous is completed. Here is my attempt: #!/bin/ksh export weeks="1 ...
3
votes
5answers
945 views

Run a process to particular/dedicated pid only

I have a c program executable or shell script which I want to run very often. If I want to stop/pause or to notify something I will send signal to that process. So every time I have to check the pid ...
2
votes
1answer
121 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
233 views

Queue a task in a running shell

I often start a long running command that is bound to either CPU, Disk, RAM or Internet connection. While that is running, I find that I want to run a similar command. Let's say downloading something ...
1
vote
0answers
51 views

Why doesn't putting elinks in background and then resuming with `fg` work reliably?

The elinks program takes over the terminal to let you browse the web. But its behavior in the context of job control is wonky. If I CTRL-Z suspend an elinks session, and then try to resume it with ...
0
votes
1answer
89 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 ...
7
votes
1answer
3k 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 ...
9
votes
4answers
6k 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 ...
1
vote
3answers
7k 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 ...
0
votes
1answer
71 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 ...
1
vote
1answer
201 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
4answers
70 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 ...
3
votes
2answers
1k 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]$ ...
4
votes
1answer
381 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 ...
3
votes
3answers
710 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?
2
votes
1answer
99 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 ...
3
votes
3answers
264 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 ...
4
votes
1answer
142 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
1answer
719 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? ...
2
votes
1answer
268 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 ...
2
votes
2answers
98 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 ...
0
votes
1answer
349 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 ...
1
vote
1answer
221 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 ...
1
vote
3answers
2k 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 ...
8
votes
2answers
1k 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 ?
1
vote
2answers
892 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
166 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, ...
4
votes
1answer
4k 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
711 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 ...