LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-07-2005, 04:33 AM   #1
Plmajholm
LQ Newbie
 
Registered: Jan 2005
Location: Sweden
Distribution: SUSE 9.2 Professional
Posts: 2

Rep: Reputation: 0
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

Last edited by Plmajholm; 01-07-2005 at 04:38 AM.
 
Old 01-07-2005, 04:48 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
You can try something like this:

Code:
firefox &
The & tells the shell to "background" the process and detaches it from the terminal.
 
Old 01-07-2005, 05:22 AM   #3
Plmajholm
LQ Newbie
 
Registered: Jan 2005
Location: Sweden
Distribution: SUSE 9.2 Professional
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks!!!
 
Old 01-07-2005, 06:10 AM   #4
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
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
 
Old 01-08-2005, 06:06 AM   #5
basileus
Member
 
Registered: Nov 2004
Location: Turku, Finland
Distribution: Debian, Ubuntu, Gentoo
Posts: 388

Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
questions about shell programs sachitha Programming 1 08-21-2005 02:46 PM
Start programs from a shell script paraiso Linux - Newbie 4 04-29-2005 10:41 AM
help installing programs from the shell sempuritoza Linux - Newbie 6 01-20-2005 12:58 PM
controlling programs from a shell window fred22 Linux - Software 3 07-06-2004 11:12 PM
Will Programs work in shell? Borg Swarm Linux - Newbie 4 01-31-2004 10:07 AM


All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration