Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-30-2006, 06:11 AM   #1
LQ Newbie
Registered: Aug 2006
Posts: 2

Rep: Reputation: 0
Unhappy Running an app in background mode

hey guys, I'm a newb from birth so my question is :

How can I run with PuTTy an app in background mode? I'm tryin to run a half-life dedicated server so it's like ./hlds_run -game cstrike +ip etc. etc. and at the end a & as found in some helps, but it won't work... need help pls :|
Old 08-30-2006, 07:08 AM   #2
LQ Newbie
Registered: Oct 2003
Posts: 22

Rep: Reputation: 15
Append a '&' to the command?

./hlds_run -game cstrike +ip <whateverelse> &
Old 08-30-2006, 07:15 AM   #3
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 30
how about if you include this string within a script
and execute this in background with &
if you then issue the command jobs
I think it will show up there.
Old 08-30-2006, 12:00 PM   #4
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,210

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Originally Posted by Naikon
..and at the end a & as found in some helps, but it won't work...
The ampersand at the end is what puts things in the background.

Could you define "won't work"? Does this mean it won't go into the background? Or that it gets killed when you logoff? If it's the latter, put "nohup" in front of the command line and "&" at the end.

BTW, say you started a process in the foreground but really meant to start it in the background. You can fix this after-the-fact without killing and restarting the process with an ampersand tacked on to the end.

(1) Type ctrl-z to stop the process ("stop" does not equal "kill", a stopped process is still there - just not doing anything).

(2) Then type "bg" to restart it again, but in the background.

(3) If you want to later bring the backgrounded process back to the foreground, type "fg".

Both bg and fg accept a parameter to specify which process you want to mess with, should you be juggling multiple backgrounded processes.

p.s. - When messing with backgrounded jobs (bg, fg, etc.) the "jobs" command is your friend. It will list what you're currently running.

Last edited by haertig; 08-30-2006 at 12:11 PM.
Old 08-30-2006, 05:23 PM   #5
LQ Newbie
Registered: Aug 2006
Posts: 2

Original Poster
Rep: Reputation: 0
thnx... tryed Screening it and it worked... the app was starting with & just like it would start normally, probably too many parameters...


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
Check if an app is running and if it's not launch this app Coume Linux - General 3 07-28-2008 03:34 AM
Color background in text mode pistachio Linux - Software 2 05-17-2006 11:24 AM
Running Cedega App in Windowed Mode batorma Linux - Newbie 4 11-29-2005 04:43 PM
looking for desktop/background stats app tommyj27 Linux - Software 1 03-22-2005 07:31 AM
16 colors background console mode bretzeltux Programming 3 05-11-2004 09:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:51 PM.

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