The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
1answer
25 views

How do I run two processes and find out when one ends in bash

I was thinking to do something like this: command1 & command2 wait Will this work? I want to proceed when command2 finishes, but command1 can still be running.
1
vote
1answer
28 views

How to run a long running grep, pipe the result into less and put everything into background?

I often find myself in the situation where I need to find a code base for a given symbol like so: find src/galio -not -path './src/stapi-sdk/apilib/* -regextype posix-extended -iregex ...
0
votes
1answer
21 views

How to tell the memory usage of each background job

I am working on SGE, and I am logged on to it. I use qlogin -l mf=30G so as to get onto one compute node. I am running 2 jobs on this compute node in the background. [1] 4408 Running ...
2
votes
2answers
29 views

Modify background jobs and/or notify on job completion post-launch [duplicate]

I would like to be able to somehow modify a running command and/or get notified when a running command completes after it has been started. Normally, when I know a command is going to take a long ...
0
votes
0answers
15 views

How to run ping in background, disconnect from current terminal session and get back the ping process later on from new terminal session? [duplicate]

I want to monitor 2 of edge routers that currently have intermittent issue. I want to monitor their percentage availability using default ping parameter (1 ping per 1 second). If I run the ping ...
0
votes
1answer
72 views

How to know, when a shell command running in the backround getting killed or died

I am running a shell command which is invoking an avconv session. The command is running as a background process. When the script starts executing I am doing a curl post to a url with the created ...
1
vote
1answer
88 views

Running init script which starts a deamon in background for reducing boot time?

I'm looking for ways to speed up the boot time on a single core embedded Linux system. Significant lag happens during start up of some custom daemons. Once they are up, they do run in the background, ...
1
vote
1answer
59 views

How to run a command in background always?

the below command when I run from the terminal will keep posting the output to message.log cf logs broker-analytics > /var/www/cfbrokerlogs/message.log However, if i close my terminal it will ...
0
votes
1answer
36 views

What does “wd” mean?

What does "wd" mean in the following output of an emacs background job? $jobs [3]- Stopped emacs -nw new\ file (wd: ~/dirlinks/cs/computer_system/composition/hardware)
1
vote
1answer
20 views

why jobs doesn't list commands from script

I have a script that runs some programs in the background, but after running it, they are not listed by the command 'jobs'. Why is this? (./m_prog -t m_prog1 m_config) & (./m_prog -t m_prog2 ...
3
votes
1answer
66 views

What is the difference between letting nohup append to 'nohup.out' and explicitly redirecting it to a file?

Consider the following scenario: tail.sh: #!/bin/bash tail -f test.txt invoke.sh: #!/bin/bash nohup ./tail.sh & invoke_explicitredirect.sh: #!/bin/bash nohup ./tail.sh > out.log & ...
1
vote
1answer
148 views

What is Best Practice for running PHP in background?

When running the following on the command line it will be suspended until I issue the fg command: /usr/bin/php -r 'phpinfo();' & This is the case regardless if the PHP code is contained in a ...
2
votes
1answer
56 views

Right way of running a root task/program at background

I'm writing a program that needs to run at the background as root. (for any user) To do this I used the /etc/rc.local file. And it seems to work. The problem that I am experiencing is, when a ...
1
vote
1answer
71 views

Process id of a command ran by an user

Consider i am running just some basic command.. ls Now would the above command have a pid, when it was getting executed? If yes, then how can i determine that pid? when i try echo $! right ...
1
vote
1answer
126 views

Run a GUI application in background and reconnect later [duplicate]

Is there a way to run a Gui application (X11) in background so that if I disconnect, I can resume the running app again? I am using SmarTTY on windows to connect to remote CentOS. When I run a Gui ...
1
vote
1answer
123 views

How to run “&” operation sequentially

From my script I am running following commands: SCRIPT_1="ksh -x script1.sh & ksh -x script2.sh"; SCRIPT_2="ksh -x script3.sh & ksh -x script4.sh"; eval $SCRIPT_1; sleep 20s; eval ...
0
votes
1answer
53 views

Interactive shell in background inside another shell script

I have some problems when trying to run an interactive sh session inside a shell script. The inner sh process uses all the CPU and never terminates. To reproduce the issue simply create a file named ...
9
votes
1answer
313 views

Echoing progress from a background process without hijacking prompt

Consider the simple script hello: #!/bin/bash echo 'hello world!' Now from bash if I try to run this in the background: $ hello & [1] 12345 $ hello world! █ <--- prompt is stuck here until ...
0
votes
2answers
71 views

Creating background process and communicating with it

1st thing off, I am really a Linux newbie - knowing just some basics; there's a great chance I didn't know what I need to look for, please redirect me if you know a good source. What I'm trying to do ...
5
votes
5answers
3k views

Calling multiple bash scripts and running them in parallel, not in sequence

Suppose that I have three (or more) bash scripts: script1.sh, script2.sh, and script3.sh. I would like to call all three of these scripts and run them in parallel. One way to do this is to just ...
1
vote
2answers
145 views

Store stdout in variable and send command to background

I have a command in a bash script which I want to capture the output of and then send it to the background. How do I get this done? The following doesn't seem to work (it keeps blocking and outputs ...
10
votes
7answers
482 views

Why does my Python background process end when SSH session is terminated?

I have a bash script that starts up a python3 script (let's call it startup.sh), with the key line: nohup python3 -u <script> & When I ssh in directly and call this script, the python ...
-2
votes
1answer
52 views

Using semicolon to separate a background job from the following one? [duplicate]

Can we use semicolon to separate a background job from the following one? $ nohup evince tmp1.pdf &; nohup evince tmp.pdf & bash: syntax error near unexpected token `;'
0
votes
2answers
108 views

how to run rm in background in terminal

I have the following command to delete files in a folder that are 15 days or older: find /var/www/App/app/var/sessions* -mtime +15 -exec rm {} \; what is the best way to speed this up and run it ...
5
votes
4answers
451 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 ...
0
votes
1answer
48 views

Background a process and execute something with one command

Probably it would be easier to do just with a script, but I wonder why can't I do that with one command. What I have tried so far: $ (ls >/dev/null &) && echo $! 3135 $ (ls ...
0
votes
2answers
51 views

How to launch «gdbserver» in background?

I am communicating with a device via a serial port, and for I am launched «gdbserver» (like gdbserver :2345 myapp) it completely blocks the terminal. Neither an ampersand & symbol, nor ^z ...
1
vote
1answer
360 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 ...
2
votes
1answer
88 views

SSH fork kills connection

I am using a linux script which has the task of forwarding control of the system to remote support. In this script one of the commands is a ssh port forward command that will forward the port of the ...
1
vote
2answers
108 views

What is/are the advantage(s) of running applications in backgound?

I really don't know what are the advantages of running applications in the background. Something like Application & via command line. Why exactly do we run applications in background and when ...
2
votes
0answers
82 views

Open a program (VLC) and move it to the foreground

On a Mac, specifically, when I use the VLC command line to open a video file, it opens in the background by default. How can I instead move it to the foreground whenever I run the command to open a ...
3
votes
4answers
543 views

How to return a background task to be in the foreground?

Well, the title does not say much, but I would like to know how to stop a running process after appending it with &. For example, I would like to install software foo. Now, assume, foo has many ...
3
votes
2answers
418 views

Interacting with a running interactive console program from a different process

I have a console program with an interactive shell, similar to say, the Python interactive shell. Is there an easy way to start this interactive program A and then use another program B to run A? I ...
0
votes
4answers
842 views

How to get process id of a command

We are running some command in batch mode. We need to do some more tasks once the existing command is done, so we need to wait until this command is done. For example: bsub -q gui -I calibre -drc ...
0
votes
1answer
54 views

Background Process not running?

I ran a C program with an infinite while loop in a terminal and observed one of the CPU cores shot to 100% usage. When I turn it into a background process using Ctrl+z, the CPU usage suddenly dipped ...
2
votes
1answer
120 views

Trying to achieve fake transparency in Urxvt - can only get a black background?

I'm trying to achieve a (fake) transparent gray background in my URxvt (rvxt-unicode) terminal emulator. Doing this using composite transparency works as it should, but I can't get it to work using ...
1
vote
1answer
143 views

Explanation for background tasks on bash

First, I write a simple PHP script <?php while(true) { echo 'hey'.PHP_EOL; sleep(1); } Then I run it like: php test.php & Obviously goes into background, but keeps running and ...
1
vote
1answer
56 views

Can I start a background process with a specific working directory?

Say I have this structure /masterscript /a/script1 /a/b/script2 In masterscript I spawn the other scripts as background processes: "/a/script1" & "/a/b/script2" & The problem is that ...
0
votes
0answers
25 views

How to make the process run after closing the session [duplicate]

I have started a process in Linux without a terminal multiplexer like screen or tmux, without nohup. Now I want to logout from my remote ssh session without interrupting the execution of that process. ...
1
vote
2answers
144 views

Call background process back to stdout

Is it possible to "call" a background process output to be shown in the terminal? Example: cron starts apt-get to update the system and I want to see the output of apt-get
4
votes
0answers
174 views

How do I execute in background / return early?

For reference, I'm using phpseclib to control a remote SSH server using the 'root' account. I have to start/stop a java process which is ran in the background. Stopping works fine with killall java ...
3
votes
1answer
451 views

Adding wallpapers in GNOME Shell

When executing Activities → Settings → Background, you can find three background tabs: [Wallpapers] [Pictures] [Colors] In [Wallpapers] you can find backgrounds under /usr/share/backgrounds/, but ...
3
votes
1answer
45 views

Is there an easy way to background a sudo shell?

A bit more details, what I'm looking for is some kind of ^Z for sudo shells. For instance when running a long command I can hit ^Z to suspend the command or when I do ~^Z in ssh after hitting Enter. ...
8
votes
4answers
1k views

I am using `&`: why isn't the process running in the background?

I know that I can append & to a command to run the process in the background. I'm SSH'ing into an Ubuntu 12.04 box and running a python program with $python program.py & -- but when I go to ...
5
votes
3answers
5k views

Permanent background ssh connection to create reverse tunnel: what is correct way?

Related question: initiate ssh connection from server to client Answer from there helped me a lot, this command does what I need: ssh -R 2225:localhost:22 loginOfServerWithPublicIP@publicIP So I ...
1
vote
1answer
112 views

Can't spawn backgrounded process

My team's using Pallet (think Puppet in Clojure) to automate server provisioning, but running into a fairly fundamental problem: Pallet can execute arbitrary scripts directly on target VMs, but if one ...
1
vote
1answer
129 views

getting pid of two last commands executed in background and do stuff

I wrote this bash: #!/bin/bash eval "(a command) &" pid1=$! eval "(while kill -0 $pid1; do .... ; done) &" #It creates file.txt after few seconds pid2=$! if [ -s ...
3
votes
2answers
116 views

What environment and credential is used by startup, background and service processes

Startup scripts (on boot) Processes running in (or sent to) the background (when using SSH -fN for example) Services etc... What $path variable will they be using? What credentials? Anything else I ...
6
votes
2answers
1k views

what will ¬ do in bash?

While wanting to start gitg as backgrounded through writing gitg & I accidentally typed gitg ¬. This did not cause an error, instead I got with a later command in the same terminal (translated): ...
9
votes
4answers
587 views

Terminate every background process

I have a few Stopped background processes. kill $(jobs -p) and kill `jobs -p` have no effect kill %1, kill %2, etc. successfully terminate individual processes How can I kill every background ...