↑ ↓ select, Enter open, Esc close

Show memory, swap areas and swappiness

user@server
free -h && swapon --show && cat /proc/sys/vm/swappiness

free -h shows total, used and available for RAM and swap; the available column is what matters, not free. swapon --show lists swap files and partitions with size and usage, and the last number is the swappiness (default 60). Lower values make the kernel swap out later.

Note: If swapon --show prints nothing, no swap is configured. Which processes are swapped out is covered by the entry on swap usage per process.

Also searched as

  • how much ram is free
  • does the server have swap
  • show swappiness value

Related one-liners

All in System and hardware

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.