HowTo: Check Swap Usage In Solaris Unix

To check the swap usage in Solaris Unix, you can use the swap command. The swap command displays information about the swap space usage on the system, including the total amount of swap space, the amount used, and the amount available.

Here’s an example of the swap command output:

$ swap -s
total: 70412k bytes allocated + 41968k reserved = 114680k used, 558888k available

In this example, the total amount of swap space is 114680 KB and 558888 KB is available.

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

$ swap -s | awk '{ print $11, $7 }'
114680k 70412k

This command uses the awk utility to parse the output of the swap command and display only the relevant information (the 11th and 7th columns).

Leave a Comment