Linux – command to check swap size

Swap space is the area on a hard disk which is part of the Virtual Memory. Swap space temporarily holds memory pages that are inactive.

Some ways to find swap usage on Ubuntu Lunux

Using free

$ free
             total       used       free     shared    buffers     cached
Mem:       1016324     921780      94544      66052      71068     261368
-/+ buffers/cache:     589344     426980
Swap:            0          0          0

Here swap is not configured.

Using /proc/swaps file

$ cat /proc/swaps
Filename				Type		Size	Used	Priority

Using /proc/meminfo

$ grep SwapTotal /proc/meminfo
SwapTotal:             0 kB

Using top

$ top
KiB Swap:        0 total,        0 used,        0 free.

Using swapon

swapon -s (summary) command lists swap summary

$ swapon -s
Filename				Type		Size	Used	Priority
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit


Click here to write/view comments