Operating System - HP-UX
1827663 Members
3752 Online
109966 Solutions
New Discussion

Re: Simple background/foreground question

 
SOLVED
Go to solution
Steve Ferrara
Advisor

Simple background/foreground question

Hi,

Not sure if this can be done....is it possible to put a job that is running in the foreground into the background?

I kicked off a backup in the foreground and want to put it in the background now.

THanks
3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: Simple background/foreground question

From man sh-posix(1):

bg [job]...

Put the specified jobs into the background. The current job is put in the background if job is unspecified. See the "Jobs" subsection for a description of the format of job.


Pete

Pete
Jeff Schussele
Honored Contributor
Solution

Re: Simple background/foreground question

Hi Steve,

The job is specified as %X where X=job number.
Determine the job number with the jobs command.
Then you'd
bg %1
for example to put the #1 job in the background
fg %1
would bring it back in the foreground.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sundar_7
Honored Contributor

Re: Simple background/foreground question

Steve,

You can use ^Z (Control-Z) to put the foreground job in the background.

It will stop the job. You will have to start it again using bg command.

if Control Z is not working for you, you will have to define susp using stty

# stty susp ^Z

- Sundar.
Learn What to do ,How to do and more importantly When to do ?