How to move terminal opened application to background?

When in terminal I type firefox (only an example) the browser starts but terminal is locked - by locked I mean that I can’s use it till I close firefox or kill firefox with ctrl+c

I know that I can run applications this way:
firefox &
That’s ok but can I do something if I run firefox without & by mistake?
Can I move the process to the background and be able to use this instance of terminal?

Create an alias …

alias firefox='firefox &'

or whatever you want to call it, with that command :slight_smile:
.bashrc or .zshrc

1 Like

That’s why I wrote

& at the end of the command is the only way?

You can use instead:
nohup firefox </dev/null &>/dev/null &
So then even if you close the terminal, FF will continue running.

1 Like

Maybe I don’t understand something so to the point
If I start application from the terminal and as an example
Pure firefox without any prefixes or suffixes.
Then I have to close firefox to “free” terminal? (close firefox = press close button on firefox or use ctrl+c shortcut in terminal)

Yes. The terminal when starts an application like that, or any command that is still running, is in a JOB state. When you give the terminal more specifics, then things can be controlled differently, but for that you need to master terminal commands. :slight_smile: I’m not one of those, so maybe someone else passes by with more suggestions for you.

Actually you can type CTRL+Z and then put firefox to background with bg and then run it in background with bg %jobid. Where jobid is the number which can be found out with jobs command.

Many steps though.


True but this is the answer I’ve been looking for :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.