I've recently come to like setsid. It starts off looking like you're just running something from the terminal but you can disconnect (close the terminal) and it just keeps going.

This is because the command actually forks out and while the input comes through to the current terminal, it's owned by a completely different parent (that remains alive after you close the terminal).

An example:

setsid gnome-calculator

I'm also quite partial to disown which can be used to separate a process from the current tree. You use it in conjunction with the backgrounding ampersand:

gnome-calculator & disown

I also just learnt about spawning subshells with parenthesis. This simple method works:

(gnome-calculator &)

And of course there's nohup as you mentioned. I'm not wild about nohup because it has a tendency to write to ~/nohup.out without me asking it to. If you rely on that, it might be for you.

nohup gnome-calculator

And for the longer-term processes, there are things like screen and other virtual terminal-muxers that keep sessions alive between connections. These probably don't really apply to you because you just want temporary access to the terminal output, but if you wanted to go back some time later and view the latest terminal activity, screen would probably be your best choice.

The internet is full of screen tutorials but here's a simple quick-start:

  • https://thingsilearned.com/things/gnu-screen-super-basic-tutorial/
Answer from Oli on askubuntu.com
Top answer
1 of 10
228

I've recently come to like setsid. It starts off looking like you're just running something from the terminal but you can disconnect (close the terminal) and it just keeps going.

This is because the command actually forks out and while the input comes through to the current terminal, it's owned by a completely different parent (that remains alive after you close the terminal).

An example:

setsid gnome-calculator

I'm also quite partial to disown which can be used to separate a process from the current tree. You use it in conjunction with the backgrounding ampersand:

gnome-calculator & disown

I also just learnt about spawning subshells with parenthesis. This simple method works:

(gnome-calculator &)

And of course there's nohup as you mentioned. I'm not wild about nohup because it has a tendency to write to ~/nohup.out without me asking it to. If you rely on that, it might be for you.

nohup gnome-calculator

And for the longer-term processes, there are things like screen and other virtual terminal-muxers that keep sessions alive between connections. These probably don't really apply to you because you just want temporary access to the terminal output, but if you wanted to go back some time later and view the latest terminal activity, screen would probably be your best choice.

The internet is full of screen tutorials but here's a simple quick-start:

  • https://thingsilearned.com/things/gnu-screen-super-basic-tutorial/
2 of 10
79

Here's the two ways I'd go with. Firstly, not running it from a terminal; hit Alt+F2 to open the run dialog, and run it from there (without &).

From a terminal, run

nm-applet &

But do NOT close the terminal yourself. That is, do not hit the X-button to close, and do not use File -> Exit from its menubar. If you close the terminal that way, it will send a HUP (Hang UP) signal to the bash running within, which in turn will send the HUP signal to all its children (which is why nohup works in this case).

Instead, exit the shell by running exit or hitting Ctrl+D. bash will then disown its children, then exit, leaving the background processes still running. And when bash exits, the terminal has lost its child process, so it will close too.

Doing it all at once:

nm-applet & exit
🌐
Linuxize
linuxize.com › home › linux commands › how to run linux commands in the background
How to Run Linux Commands in the Background | Linuxize
May 25, 2026 - Run Linux commands in the background using &, disown, and nohup. This guide explains how to start background processes, move foreground jobs to the background, and keep processes running after the …
Discussions

background process - Run a command without making me wait - Unix & Linux Stack Exchange
You can run a command in the background simply by putting & sign after it. ... You can further redirect the stdout/stderr to appropriate files so that they don't appear on your terminal while you are doing something. See this for more info: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html ... You can also pop the script/program ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
December 4, 2013
bash - How can I put the current running linux process in background? - Stack Overflow
I have a command that uploads files using git to a remote server from the Linux shell and it will take many hours to finish. How can I put that running program in background? So that I can still ... More on stackoverflow.com
🌐 stackoverflow.com
Running a terminal command in the background
Use screen. You can detach and attach, close the terminal, reconnect later. You can also simply background it with a & at the end which frees up the terminal but it needs to remain open. Use 'fg' to foreground it back. If you are using a window manager, Ctrl + Alt +F1-F10 will drop you to a TTY. On of them Fn is your window manager. So you can jump back easily, usually F6 or F8. If you are on a remote machine, use screen. You can also use it to manage a bunch of terminals, split screen, etc. More on reddit.com
🌐 r/linuxquestions
30
4
August 8, 2025
Terminal: how do I run a command, send it to the background and return to the shell without killing the process.
In addition to what others have said, if you run a program, background it with Ctrl-Z, run bg to let it run in the background, then you can additionally run disown to detach the now-backgrounded process from the terminal. This lets you close the terminal window without affecting the backgrounded program. More on reddit.com
🌐 r/linuxquestions
45
110
November 8, 2022
People also ask

How do I run a command in the background and log its output?
Redirect output to a file: `command > output.log 2>&1 &`. To also keep it running after logout, combine with `nohup`: `nohup command > output.log 2>&1 &`.
🌐
linuxize.com
linuxize.com › home › linux commands › how to run linux commands in the background
How to Run Linux Commands in the Background | Linuxize
What happens to background job output if I close the terminal?
If you used `&` alone, the process is terminated by `SIGHUP` and any buffered output is lost. If you used `nohup`, output is saved to `nohup.out`. If you used `disown`, the process continues but may error when trying to write to the closed terminal.
🌐
linuxize.com
linuxize.com › home › linux commands › how to run linux commands in the background
How to Run Linux Commands in the Background | Linuxize
Can I run multiple commands in the background at the same time?
Yes. Append `&` to each command. Use `jobs -l` to see all running background jobs and their job IDs.
🌐
linuxize.com
linuxize.com › home › linux commands › how to run linux commands in the background
How to Run Linux Commands in the Background | Linuxize
🌐
TecMint
tecmint.com › home › linux commands › how to run linux commands in background and detach in terminal
Run Linux Commands in Background and Detach From Terminal
July 14, 2023 - In this guide, we will explain how to start or run a Linux command or process in the background and completely detach a process from its controlling terminal.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to run linux commands in background
How to Run Linux Commands in Background | phoenixNAP KB
December 22, 2025 - Another way to run commands in the background is with Tmux, a terminal multiplexer utility. The tool allows users to manage multiple terminal sessions within a single shell. Users can create new windows, split panes, and switch between them, ...
Find elsewhere
🌐
Veeble
veeble.com › home › linux › how to run a linux command in the background using ‘&’
How to Run a Linux Command in the Background using '&' - Veeble Hosting
February 19, 2025 - To initiate a command in the background, simply append “&” to the end of the command you want to run. For example, if you want to run a script named myscript.sh in the background, you would type ./myscript.sh & in your terminal and press Enter.
🌐
Scaler
scaler.com › home › topics › how to run a process in the background in linux?
How To Run a Process in the Background in Linux? - Scaler Topics
March 26, 2024 - Choose from our industry-leading programs designed for career success ... The screen command is a powerful tool that allows you to create and manage multiple terminal sessions within a single shell session. It enables you to detach and reattach to these sessions, making it an ideal solution for running processes in the background that need to persist even after you close the terminal.
Top answer
1 of 1
265

Suspend the process with CTRL+Z then use the command bg to resume it in background. For example:

Copysleep 60
^Z  #Suspend character shown after hitting CTRL+Z
[1]+  Stopped  sleep 60  #Message showing stopped process info
bg  #Resume current job (last job stopped)

More about job control and bg usage in bash manual page:

JOB CONTROL
Typing the suspend character (typically ^Z, Control-Z) while a process is running causes that process to be stopped and returns control to bash. [...] The user may then manipulate the state of this job, using the bg command to continue it in the background, [...]. A ^Z takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded.

bg [jobspec ...]
Resume each suspended job jobspec in the background, as if it had been started with &. If jobspec is not present, the shell's notion of the current job is used.

EDIT

To start a process where you can even kill the terminal and it still carries on running

Copynohup [command] [-args] > [filename] 2>&1 &

e.g.

Copynohup /home/edheal/myprog -arg1 -arg2 > /home/edheal/output.txt 2>&1 &

To just ignore the output (not very wise) change the filename to /dev/null

To get the error message set to a different file change the &1 to a filename.

In addition: You can use the jobs command to see an indexed list of those backgrounded processes. And you can kill a backgrounded process by running kill %1 or kill %2 with the number being the index of the process.

🌐
Linux Handbook
linuxhandbook.com › run-process-background
How to Run Linux Commands in Background & Bring Them Back
June 1, 2023 - To run a Linux command in the background, all you have to do is to add an ampersand (&) at the end of the command, like this: ... Let’s take a simple bash sleep command and send it to the background.
🌐
LinuxConfig
linuxconfig.org › home › how to run command in background on linux
Run Commands in Background on Linux Effectively
April 10, 2021 - Thus, we can have a job in the background, close the terminal, and still see it running in the background. Here’s an example. $ nohup sleep 10000 & [1] 1908 nohup: ignoring input and appending output to 'nohup.out' We have closed the terminal and reopened it, then ran the following command, which shows the command is still running. $ ps aux | grep sleep linuxco+ 1908 0.0 0.0 8084 524 ?
🌐
Linux Hint
linuxhint.com › linux-command-run-background
How to Run Linux Commands in the Background – Linux Hint
Using tmux we can create multiple terminal sessions within a single shell. It provides the ability to run processes in the background. To run a background process in Tmux, you can create a new session and then detach from it using the key combination Ctrl-b followed by d. To install tmux utility ...
🌐
OperaVPS
operavps.com › docs › 8 top methods to run linux commands in background
✅ 8 Top Methods to Run Linux Commands in Background
April 22, 2026 - Increase your productivity by learning how to run Linux commands in background. To run Linux commands in the background, you can add '&' (ampersand) at the end of commands or use nohup, bg, and disown commands or tools like screen and tmux.
🌐
Veeble
veeble.com › home › linux › how to run and keep linux command in background?
How to Run and Keep Linux Command in Background? - Veeble Hosting
March 12, 2025 - The at command schedules command for future execution, independent of your terminal session. Install it using: ... Replace command with your desired command. For example, to run a Python script in the background for the next 2 minutes:
🌐
LinuxTechi
linuxtechi.com › home › how to › how to run linux shell command / script in background
How to Run Linux Shell Command / Script in Background
November 15, 2021 - To run a command or a script to the background, terminate it with an ampersand sign (&) at the end as shown. ... NOTE: Ending the command with the ampersand sign does not detach the command from you.
Address   Plot No - 1065, 131001, Sector - 15
🌐
MakeUseOf
makeuseof.com › home › linux › how to run linux commands in the background
How to Run Linux Commands in the Background
July 14, 2023 - The easiest way to run a Linux background command is to add an Ampersand (&) symbol after the command. For example, if you start the gedit text editor from your terminal, you can not use the shell until you close the editor.
🌐
HubPages
discover.hubpages.com › technology › Run-process-in-background-linux-terminal
Run Process in Background Linux Terminal - HubPages
August 14, 2024 - But now the process is running in the foreground on your open terminal. VLC’s lifecycle is closely tied to the terminal and blocks other actions on the terminal. If you don’t have VLC, use the ‘gnome-calculator’ for example. When you start the process this way, you’ll see the shell waits (blocks) until the program finishes or is terminated.
🌐
Reddit
reddit.com › r/linuxquestions › running a terminal command in the background
r/linuxquestions on Reddit: Running a terminal command in the background
August 8, 2025 -

How to run a command in the background without the terminal open? Example: i want to run watch - - interval 300 chown - R directory * but I don't want to keep the terminal or open the whole time it's running. How do I go about this?

Top answer
1 of 26
14
Use screen. You can detach and attach, close the terminal, reconnect later. You can also simply background it with a & at the end which frees up the terminal but it needs to remain open. Use 'fg' to foreground it back. If you are using a window manager, Ctrl + Alt +F1-F10 will drop you to a TTY. On of them Fn is your window manager. So you can jump back easily, usually F6 or F8. If you are on a remote machine, use screen. You can also use it to manage a bunch of terminals, split screen, etc.
2 of 26
6
Putting '&' on the end of a command line will cause the shell to run the command "in the background", meaning it will start the program and not wait for it to exit before giving you a shell prompt again. You can use "fg" to bring it back to the foreground (or if you have multiple backgrounded programs, it will show you a job number when you start a new program backgrounded, and you can use "%N" where N is the job number to foreground that job). You can also start a program foregrounded, then use CTRL-Z to stop it and use the shell command "bg" to put it in the background. However, if a backgrounded program generates output or prompts for input, the shell may stop it and you would need to foreground the program again to get it to continue to run. So generally you should either make sure programs you want to run in the background don't generate output or prompt for input, or make sure that the standard input and output of the program are not connected to a terminal by using input and output redirection to connect those to files instead ("outputfile", or sometimes /dev/null instead of a real file if you want to prevent any input or throw away any output). Or as other commenters mention use a program like "screen" or "tmux" which will run your program with its standard input and output connected to a pseudo-TTY managed by "screen" or "tmux" which will handle its input and output for you.