The tag has no wiki summary.

learn more… | top users | synonyms

6
votes
2answers
948 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
209 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
82 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 ...
3
votes
2answers
145 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
54 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
1answer
203 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 ...
1
vote
3answers
59 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 ...
0
votes
3answers
2k views

Can't set background wallpaper in Gnome 3

I am using Debian Testing and Gnome Flashback (but it behaves the same in standard Gnome Shell). It gives me plain white background, and I can't set my own. Also, the settings dialog for background ...
0
votes
4answers
55 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.
3
votes
3answers
66 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 >> ...
53
votes
6answers
29k views

How can I close a terminal without killing the command running in it?

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 ...
5
votes
3answers
89 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 ...
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 ...
1
vote
1answer
53 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 ...
0
votes
2answers
107 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, ...
8
votes
3answers
176 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
1answer
49 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 > ...
3
votes
1answer
789 views

bash: Run command in background and capture pid [duplicate]

Am writing a bash 4.1 script... Would like run another script (or internal function) in the background... And capture the pid of that background job in a variable in the foreground script... If the ...
1
vote
2answers
126 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
1k 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?
0
votes
4answers
221 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 ...
11
votes
3answers
1k 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
272 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
57 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 ...
7
votes
3answers
190 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 ...
3
votes
2answers
99 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]$ ...
2
votes
1answer
76 views

Difference between process in background and daemon [duplicate]

What is technically the difference of a process that started in foreground and was manually put into background and a daemon? Do they have different properties?
2
votes
5answers
441 views

How to start a program in the background

The program Boblight does not run in background. There is no noticeable difference between executing sudo boblightd and sudo boblightd& How can I solve this problem that the console will ...
0
votes
1answer
147 views

RedHat / CentOS 5.5 background process has restricted memory

I run Fisheye that uses Java for Linux. Settings go like this: generate options FISHEYE_OPTS=`$JAVACMD -Xms100m -Xmx200m -cp $FISHEYE_HOME/fisheyeboot.jar com.cenqua.fisheye.boot.OptsSetter` build ...
1
vote
3answers
66 views

ssh targetHost &; fg - does not work, but why?

I was trying the following combination in order to get the pid of the ssh session (running in the background displays the pid) and than fg to get back to the ssh session and introduce the password: ...
12
votes
3answers
786 views

Wait command usage in Linux?

#!/bin/bash function back() { sleep $1 exit $2 } back $1 $2 & b=$! if `wait $!`;then echo success else echo failure fi bash-3.00# ./back 300 0 failure bash-3.00# ./back 300 1 ...
4
votes
2answers
235 views

“nohup sudo …” does not prompt for passwd and does nothing

When I run nohup sudo myscript.sh & I only get something like [1] 1220 in return and do not get prompted for a password. The process does not start either. I want to run this script in the ...
13
votes
2answers
568 views

How to background a command chain?

I want to background a command chain like cp a b && mv b c && rm a. I have tried doing cp a b && mv b c && rm a & but this only backgrounds the last process. How ...
12
votes
7answers
23k views

Execute remote commands, completely detaching from the ssh connection

I have 2 computers, localpc and remoteserver. I need localpc to execute some commands on remoteserver. One of the things it needs to do is start a backup script that runs for a number of hours. I ...
1
vote
1answer
41 views

How to customize a backend running job completion message?

Here is the situation, I am running a command (my own executives), in bash shell (Ubuntu), say something like this: [newbie@office currentCaseAFolder]$ FEMSolver & So that the FEMSolver job is ...
1
vote
2answers
371 views

How to bring back SSH session that was started with the -f option (run in background)

I'm pretty lost on this. From the man page: -f Requests ssh to go to background just before command execution. After starting SSH with the -f option, I have a working tunnel. But after I ...
4
votes
4answers
3k 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 ...
1
vote
1answer
56 views

How and where can I permanently set $ program file to have extra argument '&'

When I run a program from terminal like so: $ program file For example $ gedit myfile.txt I cannot think of a time when I would not prefer to use '&' so that I can free up my terminal ...
2
votes
3answers
975 views

How to send to background a running process started with sudo?

I have just installed SLC6 (derived from SL6 derived from RHEL6). I can send a running process to the background by hitting Ctrl-Z in the terminal where it was started. However, I can't do it when I ...
21
votes
3answers
3k views

How to do nothing forever in an elegant way?

I have a program which produces useful information on stdout but also reads from stdin. I want to redirect its standard output to a file without providing anything on standard input. So far, so good: ...
2
votes
0answers
911 views

How to run ssh -t user@remote 'sudo nohup bash -c “comand”' in background

I want to run a script on a remote host with sudo privilege, someone suggests that I should use nohup and ssh -t, like the following command: The script ls; sleep 10; echo finish is crafted here to ...
0
votes
1answer
47 views

Background Tasks on Multicore machine?

Say I have a dual core cpu running linux. If I start two single threaded processes (nodejs) in the background, how are they scheduled? Can I assume that the OS will as best as it can, attempt to ...
7
votes
3answers
690 views

How do you send command line apps directly to the background?

I already know that pressing ctrl+z stops the app, then I can send the app to background with the bg command, but that means there is a brief preiod of time that the app is stopped. How do I send the ...
3
votes
1answer
655 views

background process pipe-input

if i want to display "aaa" on screen: (1)$: echo aaa | cat ... works OK (2)$: echo aaa | ( cat ) ... works OK (3)$: echo aaa | ( cat & ) ... NOT working ...
1
vote
2answers
1k views

How to know if a background job is finished?

I invoke a script (do_something) in background via another script (do_manythings) as below. nohup do_something & How would I know in the parent script (do_manythings) that the job invoked ...
1
vote
4answers
159 views

Where to put a background script

I have a script that i want to be constantly running in the background but I don't know where to launch it from If I put it in .bashrc it will run multiple times (one for each login) It's an ...
6
votes
3answers
352 views

is there something like a per-user daemon?

I need to run some background processes that live as long as I am logged in with a certain user. Does there exist something like a per-user daemon? I know only of global daemons that live from ...
2
votes
1answer
430 views

How to wait for a subprocess used for I/O redirection?

Consider the following snippet of Bash script: exec 3> >(sleep 1; echo "$BASHPID: here") do-something-interesting exec 3>&- wait $! echo "$BASHPID: there" When executed, it produces: ...
3
votes
1answer
364 views

Is there a way to temporarily change the terminal colour?

I use the gnome-terminal and most of my editors with a white on black theme as I find its easier on the eyes. One of my labs requires screenshots of the terminal (with the process) to be submitted ...
2
votes
1answer
1k views

Ksh Script to ftp multiple directories simultaneously

I'm new to this site and i have this problem: I have a directory in unix with multiple directories in it. Each directory have around 5k files in it. So we are talking about 40k to 50k files. I need ...