LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Running programs with shell (https://www.linuxquestions.org/questions/linux-newbie-8/running-programs-with-shell-274928/)

Plmajholm 01-07-2005 03:33 AM

Running programs from shell
 
Is there any way of starting a GUI program from shell and not run it trough that shell?
(So i can close that terminal window and keep the GUI program).

Thanks.
//Plmajholm

Dark_Helmet 01-07-2005 03:48 AM

You can try something like this:

Code:

firefox &
The & tells the shell to "background" the process and detaches it from the terminal.

Plmajholm 01-07-2005 04:22 AM

Thanks!!! :D

scuzzman 01-07-2005 05:10 AM

if you forget to append the &, you can background the process this way:
Code:

$ firefox
<Ctrl>+Z
$ bg

firefox - launches firefox, successfully ties up your shell
<Ctrl>+Z - Hold Ctrl, press Z - suspend the process
bg - stick a suspended process in the background

if you have multiple suspended processes, get the process number with
Code:

$ps
and background it with
Code:

$bg PROC_NUM
replacing PROC_NUM with the process number.

Enjoy

basileus 01-08-2005 05:06 AM

You can also use

jobs

to see which jobs are running from the terminal, for example my jobs:

[1]+ Stopped less
[2]- Stopped nano

As said, Ctrl-Z stops running program (puts it on above joblist)

bg %1 would - in case above - background "less", and bg %2 would do so to "nano"

fg %<number> in contrary activates the chosen program.

This is in my opinion easier than to use "ps" to see which process to background


All times are GMT -5. The time now is 10:45 PM.