When the physical memory or RAM on our system is full we make use of the swap space on our systems. In this process, the inactive pages of our memory are moved to the swap space creating more memory resources. This swap space is especially useful when a system is low on memory. Since swap space is located on the hard drive it slower slower to access and should not be considered a good alternative to RAM.
free
$ free
THIS COMMAND IS USED TO CHECK MEMORY AND SWAP UTILIZATION ON YOUR SYSTEM IN A FEW LINES. WITHOUT THE USE OF ANY SWITCH. THE DISPLAYED OUTPUT IS PRINTED IN KILOBYTES.
free -h
$ free -h
WITH THE -H SWITCH, THE FREE COMMAND DISPLAYS THE MEMORY AND SWAP UTILIZATION IN A HUMAN READABLE FORMAT.
\
The swapon command
$ swapon -s
YOU CAN USE THE SWAPON COMMAND TO CHECK THE SWAP ON A:
PARTICULAR PARTITION LOGICAL VOLUME OR A FILE.
WE WILL USE IT WITH THE -S (SUMMARY) SWITCH IN ORDER TO GET SWAP DETAILS (IN KILOBYTES).