Your Ad Here

IBM AIX/UNIX system storage administration ksh/perl scripting

Tuesday, March 18, 2008

The ps command enhancement (5300-05)

From redbook "AIX 5L Differences Guide Version 5.3 Addendum".

The ps command has been enhanced in AIX 5L Version 5.3 5300-05. The command is used to show the current status of processes. Now it also providesprocess hierarchy information and a listing of descendant processes for givenPIDs. AIX 5L introduces three new options for the ps command, provided inTable 4-1.

Table 4-1 Flags of ps command

Flag Purpose
-Z Displays the page size settings of processes using three columns:DPGSZ indicates the data page size of a process.SPGSZ indicates the stack page size of a process.TPGSZ indicates the text page size of a process.

-L pidlist passed to it in the pidlist variable. The pidlist variable is a list ofcomma-separated process IDs. The list of descendants from all ofthe given PID is printed in the order in which they appear in theprocess table.

-T pid Displays the process hierarchy rooted at a given PID in a tree formatusing ASCII. This flag can be used in combination with the -f, -F, -o,and -l flags.

Example: The ps command new flags

# ps -efgrep [Ii]netd
root 282800 233670 0 Feb 16 - 0:00 /usr/sbin/inetd


# ps -L 282800
PID TTY TIME CMD
282800 - 0:00 inetd
512024 pts/3 0:00 dsmadmc
585896 pts/0 0:00 ksh
684180 pts/0 0:00 ksh
749668 - 0:00 telnetd
823476 pts/0 0:00 ksh
901212 pts/3 0:00 ksh
950364 pts/0 0:00 ksh
974978 - 0:00 telnetd

You can find all of he processes including their hierarchy in an ASCII tree formatby entering:

ps -T 0

The -T option is used to find all of the processes and sub-processes under aspecific user by providing the user’s Telnet IP address.

1. Find out the pts number of the user by giving the host name or the IP address:

# who
root pts/0 Nov 30 08:41 (kcyk04t.itsc.austin.ibm.com)
root pts/1 Nov 30 08:44 (proxy)
root pts/2 Nov 30 08:50 (kcbd0na.itsc.austin.ibm.com)

2. Find the shell for this user:

# ps -efgrep "pts/2"
root 254084 250022 0 08:50:49 pts/2 0:00 -ksh

3. Use ps -T options:

# ps -fT 254084

The -Z option of the ps command is added to support different page sizes. Formore information about Huge Page support and Large Page support in AIX 5LVersion 5.3, refer to 4.3, “Multiple page size support (5300-04)” on page 79.

No comments:

Labels

BlogCatalog