Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the jobs and ps commands in linux?

Tags:

linux

unix

Please tell me the differences in information displayed by two commands jobs and ps in unix operating system?

like image 717
Abhishek Gupta Avatar asked Jul 03 '12 06:07

Abhishek Gupta


People also ask

What is the difference between ps and jobs in Linux?

It can give you information that is internal to the shell, like the job numbers (which you can use in shortcuts like fg %2 ) and the original command line as it appeared before variable expansions. ps is an external command which can tell you about all the processes running on the system.

What is the difference between a job and a process in Linux?

Answer: A process refers to a program under execution. This program may be an application or system program. Job means an application program and it is not a system program.

What is a job in Linux?

In Linux, a job is a process that the shell is managing and hasn't finished running. Every job has a unique ID that you can use to control it regardless of whether it is in the background or foreground of your terminal session. By using the jobs utility, you can retrieve a list of all currently running jobs.

What is difference between top and ps command in Linux?

top enables you to see your processes ordered by the amount of processor power they use. ps enables you to see all your processes, or just the processes used by certain users, for example root or yourself.


1 Answers

jobs is a shell builtin. It tells you about the jobs that the current shell is managing. It can give you information that is internal to the shell, like the job numbers (which you can use in shortcuts like fg %2) and the original command line as it appeared before variable expansions.

ps is an external command which can tell you about all the processes running on the system. (By default it only shows a small subset, but there are options to select larger sets of processes to display.) It doesn't know about the shell-internal stuff.

like image 106
Alan Curry Avatar answered Sep 23 '22 05:09

Alan Curry