System Administration

Re: stopping / terminating the process and viewing stopped jobs

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

stopping / terminating the process and viewing stopped jobs

Hi

In linux we can use following commands to do

1) to stop the process:

press "ctrl+z"

2) to terminate immediately:

press "ctrl+c"

3) to view the stopped jogs:

# jobs

4) to run the stopped jobs in fore ground:

# fg jobno

5) to run the stopped jobs in back ground:

# bg jobno

6) to start in back ground:

#command &

what are the commands we have to use in HP-UX for corresponding above commands.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: stopping / terminating the process and viewing stopped jobs

Hi:

Is this a test? While LINUX evolved from UNIX and differs slightly, the core command set, particularly for shells that are similar (POSIX, ksh, bash) is the same!

Read the manpages or try things out!

...JRF...
Pete Randall
Outstanding Contributor

Re: stopping / terminating the process and viewing stopped jobs

Much the same, depending on your stty settings:

1) to stop the process:

whatever "susp" is set to

2) to terminate immediately:

whatever "kill" is set to

3) to view stopped jobs:

jobs (may depend on your shell)

4) to run stopped job in FG:

fg jobno

5) to run stopped job in BG

bg jobno

6) to start job in BG

command &


Pete




Pete
T G Manikandan
Honored Contributor

Re: stopping / terminating the process and viewing stopped jobs

Many different Unix shells are available and they are common across the unix flavors.
So these commands work similar.
Bijeesh
Respected Contributor

Re: stopping / terminating the process and viewing stopped jobs

Hi,
The commands are same,but you can see the special key combinations using stty -a command.

rgds
Bijeesh
Ganesan R
Honored Contributor
Solution

Re: stopping / terminating the process and viewing stopped jobs

Hi Senthil,

These are the few tips about job control.

# ll /usr >mylist & -->Starts the job in the background and return to the shell prompt
[1] 11633 --> is job id and 11633 is process id

#jobs -->Will show the jobs running in the background and job id and status of the jobs

You can then use this job ID to bring a job into the foreground at any time.

# jobs
[1] + Stopped vi myfile
[2] - Running vi file2

#jobs -l ->Jobs with -l options shows the PID of all jobs

Suspending a Foreground Job
Press ^z(stty susp value) to suspend the current foreground job. Again use â fgâ command to bring the suspended and background jobs

Resuming Suspended Jobs and Bringing Background Jobs to the Foreground
#fg -->Will bring the current into foreground
#fg %
#fg %2 -->will bring the job id2 to foreground
#fg
#fg vi file2 -->Will bring the job â vi file2â to foreground

Moving Jobs to the Background:
#jobs
[1] + Stopped vi myfile
[2] - Stopped vi file2

#bg %2 -->Start the job id 2 and keep running in background
#wait -->Will stop the command prompt until all background jobs get finished
#wait %2 --> Will stop the command prompt until background job id 2 get finished
Best wishes,

Ganesh.