The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
5answers
156 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
32 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 ...
4
votes
2answers
89 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
30 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
68 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
306 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
25 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
27 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
51 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
0answers
34 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
60 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
48 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
345 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
101 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
89 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
26 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
52 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
123 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
42 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
24 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
59 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
112 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
147 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
41 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
810 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 ...
4
votes
3answers
2k 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
77 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
70 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
83 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): ...
8
votes
4answers
427 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 ...
4
votes
2answers
358 views

Opening a file with program in background from shell

The command to launch a program, say evince, from bash shell in background is evince & But what if I want to open some file with evince in background? Nor evince myfile.pdf & neither evince ...
4
votes
2answers
5k views

Shell script wait for background command

I am writing a script, but there is something I need that I can't find a way to do it... I need to make a command in background "command1 &" and then somewhere in the script I need to wait for it ...
1
vote
1answer
75 views

What does ^Z mean?

I tried using ^Z to send and application to the background(to then use fg to restore) but I notice that it says "Stopped" and in another terminal while monitoring htop, everything just freezes. Is ...
1
vote
3answers
557 views

`wait` doesn't wait for `wget --background`

I have gone through several SE posts on the unix wait command and none of the posts resolve my problem. I have a weather forecast model to run. It has first to prepare some folders, then download data ...
3
votes
3answers
147 views

Log to multiple files while process in background (nohoup)

I have bash script that logs to two log files in parallel. echo "$(date) | [STATE] Activating IP forwarding" >> $logsPath$logFileName echo $(date +"%Y-%m-%d %H:%M")","$previousState >> ...
0
votes
3answers
107 views

My ubuntu background is totally black, even after opening programs such as terminal

My Ubuntu background is totally black when I log in. I can open the terminal, write command so that i open other programs, but I am unable to see any of it.
6
votes
3answers
3k views

reliable return code of background process

Let's assume the following piece of bash code: foo > logfile 2>&1 & foo_pid=$! while ps -p$foo_pid do ping -c 1 localhost done wait $foo_pid if [[ $? == 0 ]] then echo "foo ...
1
vote
1answer
153 views

spawning multiple Background processes

I have a file which has 2,000,000 lines in it. I am running some commands for each line. I was trying to achieve some parallelism using GNU-parallel and swift as discussed here. However, I got an ...
1
vote
2answers
1k views

How do I run two ongoing processes at once in linux/bash?

I would like to know how I can run two ongoing processes at the same time in Linux/bash. basically, I have a Node web server, and a MJPG-Streamer server. I want to run both these processes at once, ...
1
vote
1answer
241 views

Alias for redirecting both standard output and standard error, as well as sending to background [duplicate]

I am trying to create an alias for redirecting both standard output and standard error of gedit to /dev/null, whilst sending the command to background. This works: $ alias gedit='gedit $1 > ...
9
votes
3answers
442 views

If you ^Z from a process, it gets “stopped”. How do you switch back in?

I accidentally "stopped" my telnet process. Now I can neither "switch back" into it, nor can I kill it (it won't respond to kill 92929, where 92929 is the processid.) So, my question is, if you have ...
1
vote
2answers
555 views

How to terminate a background process in Linux when the pid is unknown?

I have a job dispatcher bash shell script containing below codes: for (( i=0; i<$toBeDoneNum; i=i+1 )) do while true do processNum=`ps aux | grep Checking | wc -l` ...
16
votes
9answers
2k views

How to make sure that a command is not interrupted, even if terminal is closed? [duplicate]

In Linux. Say I want to run a command and it takes too long. I just want to ensure it's done. How?
2
votes
1answer
558 views

Python script run while screen is locked

I have a python script which seems to be failing to continue running its while True: ... sleep() loop my code is at http://github.com/xdaimon/xdaimonConky What happens is I autostart python on ...
14
votes
4answers
30k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...
5
votes
6answers
5k views

Run a command without making me wait

On the CLI, sometimes a command I type takes a while to complete, and sometimes I know when that's about to happen. I'm a bit confused on "backgrounding" and such in Linux. What is the most common ...
2
votes
1answer
264 views

Dialog - Continue in background

I installed this program: http://invisible-island.net/dialog/dialog.html Now I want to use this dialog: http://invisible-island.net/dialog/dialog-figures.html#demo_gauge dialog --gauge 'Checking ...
0
votes
4answers
4k views

Opening Firefox from terminal [duplicate]

When I type firefox in terminal, it starts Firefox but the terminal "hangs". What is happening behind the scenes? Can I open Firefox from terminal and keep on using the same terminal tab for other ...
7
votes
3answers
261 views

What's the difference between && and ; when forking sleep to background?

I have just asked a question about forking a process to sleep in the backgroud. The notation I came up with myself looks like this: sleep 10 && echo "hello world" & This answer to a ...