Linux commonly used commands to view server memory

1.free

The free command is used to display the system memory status, including the usage of system physical memory, virtual memory (swap swap partition), shared memory and system cache, and its output is very similar to the memory part of the top command.

 

The basic format of the free command is as follows:

[root@localhost ~]# free [选项]

Table 1 lists the commonly used options of this command and their meanings.

Table 1 Common options and meanings of the free command
options meaning
-b In Byte (byte) as the unit, display the memory usage.
-k Display memory usage in KB, this option is the default option of the free command.
-m Displays memory usage in MB.
-g Displays memory usage in GB.
-t In the final result of the output, the total amount of memory and swap partition is output.
-o The system buffer column is not displayed.
-s interval seconds According to the specified interval, the memory usage is continuously displayed.

free view memory size -- executefree -m

free -mDisplays memory usage in MB.

The free command is used to display the system memory status, including the usage of system physical memory, virtual memory (swap swap partition), shared memory and system cache, and its output is very similar to the memory part of the top command.

free -mIn the command output list, the first line displays the column header information of each column, and their meanings are as follows:

  • total is the total memory;

  • used is the amount of memory used;

  • free is the number of free memory;

  • shared is the total amount of memory shared by multiple processes;

  • buffers is the number of buffer memory;

  • cached is the number of cache memory.

The Mem line refers to the memory usage; - the memory number of /buffers/cache is equivalent to the used-buffers-cached in the first line. +/buffers/cache memory is equivalent to free+buffers+cached in the first line; the Swap line refers to the usage of the swap partition.



2.df

df command function: Display the usage of the specified disk file. If no file is specified, displays disk usage for all mounted filesystems

       option can have

             -a: list of all file systems, including virtual file systems

             -B: Specify the display scale size, such as display in M, G

             -h: Display in a human-readable format.

             -H: Similar to -h, but 1k = 1000byte, 1M=1000k

             -i: List inode information

             -k : block size is 1024 bytes

             -l : display the local file system

             -p: use POSIX specification output

             -t: print the specified file system type

             -T: display file system type

            -x: Do not print the specified file system type

    

  The first column represents the path name of the device file corresponding to the file system (usually a partition on the hardware)

  The second column represents the number of data blocks (1024byte) contained in the partition

  The third column represents the data of the data block used

  The fourth column represents the data of the available data block

  The fifth column represents the percentage of data blocks used

  The sixth column represents the mount point of the file system.

 The reason why the third and fourth columns are not equal to the second column is that each file partition will have a default part for administrators to use. So that the administrator can log in to the system after a problem occurs.


3.du -sh *

View current directory usage

 
4.ll -h

We often use llcommands to view files/folders in a certain directory, but it is not a basic command of Linux.

It is actually ls -lan alias for , which can be abbreviated as  ll, with the same effect.

 

 

 

 

Guess you like

Origin blog.csdn.net/qq_33551131/article/details/131188987