How To Check Swap Usage On Linux

How do I check swap (paging) usage under Linux operating systems from the command line?Swap space (also known as paging) is nothing but computer memory management involving swapping regions of memory to and from storage. You can see swap usage summary by device using any one of the following commands. You may have to login as root user to use the following commands. The maximum useful size of a swap area depends on the architecture and the kernel version. For Linux kernels after v2.3.3+ there is no such limitation on swap size.

Method 1: Read /proc/swaps file

#cat /proc/swaps

The output looks something like as follows:

Filename				Type		Size	Used	Priority
/dev/dm-1                               partition	8273916	0	-1

Method 2: free command

# free -g
# free -k
# free -m