Computing.Net > Forums > Linux > putting program in bckgrnd

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

putting program in bckgrnd

Reply to Message Icon

Original Message
Name: ali
Date: March 29, 2001 at 21:38:09 Pacific
Subject: putting program in bckgrnd
Comment:

Hi :
i read in a book that in shells , unlike DOS we can put program in the background ,for example while working with Vi editor we can put it in the background and check mails.. and then return back to Vi.
can anybody please tell how do it doit, which switches are used.
thanks in advance..


Report Offensive Message For Removal


Response Number 1
Name: Mik
Date: March 29, 2001 at 23:07:31 Pacific
Reply: (edit)

I don't know of any key combination or switch which will allow you to put the program in the background while using it and then switch back. At least not in one shell window. But here are a few things which I do know of which might help.

You can start a program in the background by adding the symbol '&'. For example type "myprog &" to run your program in the background. The standard output will be displayed in your console but the program will not receive from the standard input. This is also possible in DOS though.

Depending on which distribution you have there are usually a standard set of terminal windows already opened which you can switch back and forth using the ALT+F1 ... F8 depending on how many you have. If you are using Xwindows you will be able to open several xterm, dterm or whatever windows you have.

Also in vi it is possible to execute commands while editing a file, don't think you will be able to check your mail like that though. When in command mode type ":! ls" to get a directory listing or any other command you would want to execute.

Mik


Report Offensive Follow Up For Removal

Response Number 2
Name: James Wolf
Date: April 2, 2001 at 06:35:25 Pacific
Reply: (edit)

You can put applications in the background using Ctrl Z this suspends the application returning you to a shell, to get the program back use the fg command.

Each program that you suspend is given an ID therefore if you have three programs suspended of which vi was the second, you would recall it by typing fg 2 at the command prompt...

James


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home








Do you have a Desktop Computer anymore?

No
Yes, but only at work
Yes, but its rarely used
Yes, and its a workhorse


View Results

Poll Finishes Today.
Discuss in The Lounge
Poll History




Data Recovery Software