Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-20-2006, 03:06 PM   #1
Registered: Oct 2003
Location: Finland
Distribution: Slackware 12.0
Posts: 34

Rep: Reputation: 15
Background and Foreground

Hi all,

I wanted to ask, since it has been annoying me greatly; what's the exact difference between running a program on the background or on the foreground? I see these terms a million times in various manuals and docs and it eludes me what they mean precisely.
Old 01-20-2006, 03:12 PM   #2
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,285

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Say you have a program that take 30 minutes to run (it's doing something MIGHTY intensive!)

You run it in the foreground, you'll sit there waiting at your terminal until it's done before your prompt comes back and you can interact with the OS again.

In the background, your prompt will come back immediately and you can interact [edit] with the OS [/edit] while this CPU-hog program is running "in the background". You cannot easily interact with the backgrounded program, so it should be programmed operate on it's own without user input.

Of course, you could always just open up a new terminal window, but the above explains what will happen if you're limiting yourself to only one terminal session.

Last edited by haertig; 01-20-2006 at 03:13 PM.
Old 01-20-2006, 04:20 PM   #3
Registered: Oct 2003
Location: Finland
Distribution: Slackware 12.0
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks haertig, very clarifying

To extend my original question, I take it's generally possible to write a program (in whatever language; C/C++, Java, etc.) and by default set it to run in the background or the foreground? At least I think I've seen some programs behave this way, some even have commandline parameters that allows you to run it in either.


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
tty background/foreground color neo77777 Linux - General 11 11-25-2014 08:59 AM
wine not in foreground ? kron1234 Linux - Games 1 06-01-2005 03:37 PM
How to change backgound/foreground colors in eclipse wearetheborg Linux - Software 0 09-13-2004 01:56 PM
How do I customize background/foreground colors in Eclipse? wearetheborg Linux - Newbie 0 09-10-2004 02:48 PM
loading foreground nautilus_1987 Slackware 6 10-10-2002 01:12 PM > Forums > Linux Forums > Linux - Software

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

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
Open Source Consulting | Domain Registration