Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-15-2009, 10:42 AM   #1
Senior Member
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
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?
Old 04-15-2009, 11:18 AM   #2
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
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.
Old 04-15-2009, 12:42 PM   #3
Registered: Apr 2009
Posts: 108

Rep: Reputation: 24
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.

Last edited by Tinkster; 10-30-2010 at 03:13 PM.
Old 04-15-2009, 01:38 PM   #4
Registered: Oct 2006
Location: Seattle, Washington
Distribution: Gentoo, LinuxMint, Arch Linux
Posts: 99

Rep: Reputation: 18
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 &

$sh &
the script will start in the background and you will continue to have a bash prompt.
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script to find the difference betwwn two file and place the difference to other kittunot4u Linux - General 3 07-19-2010 04:26 AM
Printer? How resume Jobs if Printer Stopped: jobs stopped? Reluctant Linux - General 0 06-03-2006 01:36 PM
fg, jobs etc ftgow Linux - General 7 02-26-2004 10:28 PM
What are the Best Jobs associated with Linux? robhargreaves Linux - General 5 01-29-2004 10:34 AM
CRON Jobs scottpioso Linux - Software 63 11-28-2003 06:45 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration