LinuxQuestions.org
Visit Jeremy's Blog.
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 04-12-2005, 06:01 AM   #1
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Rep: Reputation: 15
How to start a program in terminal and let it 'detach'


In Windows, I can directly type the program name at the command prompt. The program starts up and I am able to continue to type other commands.

Using Linux terminal, I can't do that. The command prompt is not availabe until the program exits.

Is there a command to start a program and let it 'detach' from the terminal?
 
Old 04-12-2005, 06:06 AM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Append the command with an ampersand (&) and it will run in the background. IE: If I wanted to launch Mozilla from a terminal, I'd type
Code:
mozilla &
to background it. Type
Code:
fg
to bring it back into the foreground, and
Code:
man fg
for more information. To background a task already running (IE: You forgot the ampersand the first time), press <Ctrl>+Z to suspend it, then
Code:
bg
to send it to the background. Also see
Code:
man jobs
as this will provide more information on job control.

Last edited by scuzzman; 04-12-2005 at 06:08 AM.
 
Old 04-12-2005, 06:08 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Just add a '&' character at the end of your command. Eg:
Code:
your-prompt> /usr/local/bin/firefox &
Anything that can be done in DOS can be done in Linux shells.

Yves.
 
  


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
How to run a program on another terminal SharpyWarpy Linux - General 2 02-10-2005 03:09 PM
How do I tell what version a program is from a terminal? rkid Linux - Software 3 10-14-2003 03:07 AM
terminal program metallica1973 Linux - General 4 02-24-2003 12:04 AM
terminal program metallica1973 Linux - Networking 1 02-23-2003 11:09 PM
think -detach acid_kewpie General 3 04-04-2002 06:47 AM


All times are GMT -5. The time now is 04:01 PM.

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