What's the difference between ps -A and jobs...
Aren't they both processes running in the background? Why is it that you can fg bg process listed in jobs whereas in you can't fg and bg processes listed in the ps -A output?
|
jobs, fg and bg is a separate set of programs than ps.
"Jobs" are more user-controlled, whereas ps is the age-old tool for listing processes. I highly suggest reading the man pages: ps(1) however, it seems jobs, fg and bg do not have any sort of documentation on the Debian Lenny server I am running. |
Information about jobs, bg and fg is part of the BASH_BUILTINS(1) man page. Typing jobs, bg or fg will bring up that man page automatically (at least it does that on Fedora).
ps -A does simply list all processes. No wizardry there. |
ps just lists all processes running on the system.
jobs is very different. It is a BASH built-in. It shows jobs that a user or script explicitly put in the background. press Ctrl-Z while a process is running to suspend it to the background. use bg jobnumber to resume the process (in the background) you can start a job in the background by appending a & Code:
$sh somescript.sh & any job will stay in the BG until it finishes or is brought the the fore using fg jobnumber this allows you to start and control multiple tasks You can read more: BASH Job Control BASH_BUILTINS |
All times are GMT -5. The time now is 02:54 AM. |