In today’s article, we will be learning how to query virtual memory status with the Free command.
1. The Free command displays the current virtual memory status of the system.
1 2 3 4 5 | $ free total used free shared buffers cached Mem: 16410752 16293944 116808 0 335432 14081932 -/+ buffers/cache: 1876580 14534172 Swap: 16779884 3353800 13426084 |
2. Other combinations of this command are below.
1 2 3 4 | $ free -m # Displays memory usage in MB (-m for megabytes) $ free -g # Displays memory usage in GB (-g for gigabytes) $ free -s 2 # Updates the output every 2 seconds (-s for seconds) $ watch free # Continuously displays memory usage, refreshing every 2 seconds |