Linux - SoftwareThis 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.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.