What are the methods to view memory information in Linux system?

In Linux system, you can use several methods to view memory information. Here are some commonly used methods:

  1. Use the free command:

    • Open a terminal and enter the following command:

      free
    • This will display the memory usage of the system, including total memory, used memory, free memory, and the amount of memory for buffers and caches.
  2. Use the top command:

    • Open a terminal and enter the following command:

      top
    • Press the "M" key to sort memory by usage to view the memory usage of each process.
  3. Use the htop command:

    • If htop is not installed, install it using the appropriate package manager.
    • Open a terminal and enter the following command:

      htop
    • htop provides an interactive interface that shows the memory usage of the system, including the memory usage of the process, the amount of buffer and cache memory, etc.
  4. Use the cat command to view the /proc/meminfo file:

    • Open a terminal and enter the following command:

      cat /proc/meminfo
    • This will display detailed information about system memory, including total memory, available memory, used memory, amount of memory for buffers and caches, and more.

These are common ways to view memory information in a Linux system. Depending on your needs and specific environment, you can choose a method that suits you to view memory information.

Guess you like

Origin blog.csdn.net/tiansyun/article/details/131954224