HowTo: Check Swap Usage In IBM Aix Unix

To check the swap usage in IBM AIX Unix, you can use the lsps command. The lsps command displays information about the amount of paging space (swap space) on the system, including the total amount of paging space, the amount used, and the amount available.

Here’s an example of the lsps command output:

$ lsps -s
Page Space Physical Volume Volume Group Size %Used Active Auto Type
hd6 hdisk0 rootvg 512MB 0 no no lv

In this example, there is a single paging space (hd6) with a size of 512 MB, and 0% of it is used.

To display the total amount of swap space and the amount used in MB, you can use the following command:

$ lsps -s | awk 'NR == 2 { print $3, $4, $5 }'
512MB 0MB 512MB

This command uses the awk utility to parse the output of the lsps command and display only the relevant information (the third, fourth, and fifth columns). The NR == 2 part of the script specifies that we only want to display the information from the second line of the lsps output, which contains the information about the paging space.

Leave a Comment