Using Bash shell when I run a program from it
So I open firefox from my bash shell with:
Code:
firefox google.ca Now if I alt-tab back into my shell, i can't enter any commands in the shell. I know that i can do this if I close firefox, but I want to keep working in my shell with firefox still open. Is this possible? |
Welcome to LQ!
firefox google.ca & If you add an ampersand after a command, it detaches the command and you can get back to the prompt. The nohup command (nohup firefox google.ca) will do something similar. If you really want to get fancy, you can use the screen command to create virtual terminals that you can detach and re-attach whenever you want. |
Thanks a lot!
|
press ctrl+z this will send the SIGSTOP signal.
Then type bg, this will send the process in the background, you can do fg to bring it in the forefront. |
Also, if you don't want output from the background command cluttering up your terminal as you work, do this:
Code:
firefox google.ca &> /dev/null & |
you can also check your jobs list for jobs running in the background with the command...jobs
so if you are running alot of commands in the background, use jobs to get the job number, and you can bring it to the foreground if you wish to by typing fg JOBNUMBER not relevant here really, but useful |
Another useful tip: you can keep the command running after you close the terminal using the nohup command.
|
All times are GMT -5. The time now is 05:50 AM. |