Angel Ruvalcaba
Angel Ruvalcaba

Reputation: 115

How to see the process table in unix?

What's the UNIX command to see the processes table, remember that table contains:

Upvotes: 3

Views: 10808

Answers (2)

nssboot
nssboot

Reputation: 1

Your question is open ended, and an answer to a specific question you may have had can be looked up in any man page as @Alfasin suggests in his answer. A lot depends on what you are trying to do.

As @ThomasDickey points out in his response, in UNIX and most of its' derivatives, the command for viewing processes being run in the background or foreground is in fact the ps command.

ps stands for 'process status', answering your first bullet item. But the command uses over 30 options and depending on what information you seek, and permissions granted to you by the systems administrator, you can get various types of information from the command.

For example, for the second bullet item on your list above, depending on what you are looking for, you can get information on 3 different types of pointers - the session pointer (with option 'sess'), the terminal session pointer (tsess), and the process pointer (uprocp).

The rest of your items that you have listed are mostly available as standard output of the command.

Some UNIX variants implement a view of the system process table inside of the file system to support the running of programs such as ps. This is normally mounted on /proc (see @ThomasDickey response above)

Typical reasons for understanding the working of the command include system-administration responsibilities such as tracking the origin of the initiated processes, killing runaway or orphaned processes, examining the file size of the process and setting limits where necessary, etc. UNIX developers can also use it in conjunction with ipc features, etc. An understanding of the process table and status will help with associated UNIX features such as the kvm interface to examine crash dump, etc. or to get or set the kernal state.

Hope this helps

Upvotes: -1

Thomas Dickey
Thomas Dickey

Reputation: 54525

The "process table" as such lives in the kernel's memory. Some systems (such as AIX, Solaris and Linux--which is not "unix") have a /proc filesystem which makes those tables visible to ordinary programs. Without that, programs such as ps (on very old systems such as SunOS 4) required elevated privileges to read the /dev/kmem (kernel memory) special device, as well as having detailed knowledge about the kernel memory layout.

Upvotes: 4

Related Questions