223k views
2 votes
Which Linux commands can show information about memory usage?

User Foxxero
by
7.8k points

1 Answer

4 votes

Final answer:

Linux commands such as 'free', 'top', 'vmstat', and 'htop' are commonly used to show memory usage information, each with their specifics in terms of details and interactivity.

Step-by-step explanation:

The Linux commands that can be used to show information about memory usage include:

  • free - This command provides a summary of the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel.
  • top - It displays real-time information about the system, including memory usage per process, CPU usage, and more. It's an interactive command with various options.
  • vmstat - Shows virtual memory statistics that give information about processes, memory, paging, block IO, traps, and CPU activity.
  • htop - An interactive process viewer that is a more advanced version of 'top'. It provides a colorful and detailed visualization of CPU, memory, and swap usage.

The 'free' command is often the first choice for a quick check, with 'top' and 'htop' offering more detailed insights when needed. Meanwhile, 'vmstat' can be used for more comprehensive system performance tracking over time.

Each of these commands comes with various options and flags that can give you a more refined output or report on memory usage. For students or professionals looking to monitor their system resources, these commands prove to be invaluable tools.

User Akash Nil
by
8.3k points