In terminal I just type firefox and then Firefox starts, but I can not return to
command mode anymore.
How can I come back to command mode?
I have already tried :q or exit, but neither work.
In terminal I just type firefox and then Firefox starts, but I can not return to
command mode anymore.
How can I come back to command mode?
I have already tried :q or exit, but neither work.
When you run a program from a shell (e.g. firefox) it will be executed "in foreground". When the program will finish you will have back the possibility to execute another command.
Another way to execute a command is "in background". If you put this symbol & after the command it will be executed asynchronously (in background) and you will have the possibility to execute other commands from the same shell/terminal. Excerpt from man bash:
When bash starts a job asynchronously (in the background), it prints a line
that looks like:
[1] 25647
indicating that this job is job number 1 and that the process ID of the
last process in the pipeline associated with this job is 25647.
When you start the second jobs it will answer with [2] NewPid and so on. With the built-in command jobs you will have all the list.
When you run a command "in foreground" and you want to suspend it (not to stop definitively) you can press CTRL+Z. The shell will answer you in a similar way (e.g.)
[1]+ Stopped firefox
To continue the precedent job you can write %1 & (the same number you read from the terminal). You can also do it with bg %1. It will execute the job 1 in background and give you the prompt back, ready to accept new commands.
You may find interesting the article Linux: Start Command In Background