Akhmed
Akhmed

Reputation: 1159

How not to close process, started from ubuntu terminal, and continue to execute another commands from terminal?

I'm not advanced linux user. I use ubuntu.

When I start any process from terminal, for example firefox, I type in:

firefox

The process starts and then I need to write another commands in terminal. For example, I want to change directory, but I can't do it, because firefox is started. And I don't want to close it, but want to enable terminal.

Sorry if my explanation is not clear, I do not know english well.

Upvotes: 2

Views: 6516

Answers (5)

yogesh prasad
yogesh prasad

Reputation: 151

To run any command in background just put & at the end of command

Upvotes: 0

botzko
botzko

Reputation: 630

You can start the process in the backgroun with

firefox &

If you start it with

firefox

it will be in the foreground and you can move it to the background with Ctrl+Z (this will put it in the background but the process will freez until you use bg command) then you must execute

bg 1

where 1 is the job id. You can see the job id with command

jobs

If you need to return the process to the foreground you must use

fg 1

where 1 is the job id.

Upvotes: 7

Platinum Azure
Platinum Azure

Reputation: 46183

If your command has already started, you can use Ctrl+Z to send a suspend signal to the running process. Then you can use the bg command (passing in %1 to symbolize the first process on the job list) and that will turn it into a background process, as if you had used the & in the original command.

Upvotes: 3

Michał Kosmulski
Michał Kosmulski

Reputation: 10020

If you end your command line with &, the program will run in the background and you will be able to use the terminal for other commands. Example: firefox &.

Upvotes: 1

0xC0000022L
0xC0000022L

Reputation: 21259

Simply do this here:

firefox &

drops it to the background.

Also check out the commands disown, nohup and fg.

Upvotes: 3

Related Questions