I need to run Firefox browser from terminal. Browser works fine, but terminal still waits for Firefox to return and if I do CTRL+C, it terminates Firefox. How to run command to make Firefox work independently from terminal?
Firefox 35 on Ubuntu 14.04 detaches itself from the shell, still printing errors though, to eliminate that output, try:
firefox >/dev/null 2>&1 www.google.com &
>/dev/null makes firefox's 'stdout' text stream be sent to "nowhere",
2>&1 makes 'stderr' be sent to the same place,
& detaches firefox from the shell.
With Bash "job control" of a long running process, e.g. find on
/ as in:
find -printf "%p\n" / >$HOME/LIST-OF-FILES.txt
... at any time before it finishes, you can do this:
Hold Ctrl and hit Z
+ Stopped find ...
will be printed and the shell prompt will reappear...
bg and press enter to have find continue run in the background.
Note that errors and warnings will still be printed, as in...
find: /run/lightdm: Permission denied
To stop those from appearing, add
2>/dev/null to the command line.
Another alternative to launch GUI based software is
xdg-open firefox ...
... this is more equal to actually clicking on an icon in your OS.
NOTE: Ubuntu. There are various variants of this for other Linux-variants, and MacOS.
Look up "job control" in http://www.tldp.org/LDP/abs/html/abs-guide.html - for more info.