Teach you how to quickly understand a Linux system server

to get a thing, big car, small to mobile phone, in addition to know how to use it, to further understand them to better play their abilities.

So how to understand, for a person we have to understand his strengths, and for the machine, we have to understand the specific parameters, such as the car we need to understand its power.

For bioinformatics workers, Linux system servers are the most familiar, so how to get the fastest understanding of Linux servers with simple commands.

[Storage Space] The df -h

df command is used to list the overall disk space usage of the file system. Can be used to see how much space the disk has been used and how much space is left.

和df -h is displayed in an easy-to-read way. 教你快速了解一台Linux系统服务器的方法教你快速了解一台Linux系统服务器的方法

[[email protected] home]# df -h 
Filesystem Size Used Avail Use% Mounted on 
/dev/mapper/cl-root 50G 36G 15G 71% / 
/dev/sda1 1014M 227M 788M 23% /boot 
/dev/mapper/cl-home 1.8T 450G 1.4T 25% /home 
Filesystem:代表该文件系统时哪个分区,所以列出的是设备名称。

Mounted on:磁盘挂载的目录,即该磁盘挂载到了哪个目录下面。

[Memory] The free -h

free command can display the free, used physical memory and swap memory in the Linux system. And the buffer used by the kernel.

Generally use free-h mode to check the memory usage (the same is suitable for human reading)

[[email protected] home]# free -h 
 total used free shared buffers cached 
Mem: 126G 124G 2.0G 1.6M 626M 118G 
-/+ buffers/cache: 4.5G 121G 
Swap: 15G 40M 15G 

注解:-buffers/cache reflects the memory that the program is actually eating (in this case, - The memory of buffers/cache is 4.5G, which is equal to the used-buffers - cached of the Mem line, and +buffers/cache reflects the total amount of memory that can be used. In this example, the memory of +buffers/cache is 121G. That is equal to the free + buffers + cached of the Mem line). The

Swap line data is the swap partition SWAP, which is what we usually call virtual memory. When you see that the free space of buffer/cache is low or the free space of swap is low, memory needs to be upgraded. This means that this memory utilization is very high. Note that the shared memory column should be ignored because it has been deprecated.

The above comments on free -h, some references from https://www.cnblogs.com/kex1n/p/6010496.html.

The explanation of buffers and cache is easier to understand from the explanation of https://www.zhihu.com/question/26190832. The core function of

Buffer is to buffer and mitigate shocks. For example, if you write 100 hard disks per second, it will have a big impact on the system, and it will waste a lot of time busy processing the beginning and end of writing. Use a buffer to temporarily store it, and write the hard disk every 10 seconds. The impact on the system is small, and the writing efficiency is high. The core role of Cache is to speed up access. For example, if you have finished a very complicated calculation, you will use the result next time, and you will leave the result in a good place to save it. You don't have to worry about it next time. Speed ​​up data access. So, if you pay attention to the storage system, you will find that the hard disk read and write buffer / cache name is not the same, called write-buffer and read-cache. It is clear that the difference between the two is stated.

【CPU】 cat /proc/cpuinfo

利用cat查看服务器cpu info

[[email protected] home]# cat /proc/cpuinfo|grep "processor" |wc -l 
32 
[[email protected] home]# cat /proc/cpuinfo|grep "physical id" |sort|uniq|wc -l 
4 
[[email protected] home]# cat /proc/cpuinfo|grep "cpu cores" |uniq 
cpu cores : 8 

注解: The above three commands from top to bottom represent 1 total logical CPU number: 32; 2 physical CPU number: 4, if this is 2, it means two-way server, 4 is four-way Server; 3 cores per physical CPU: 8. Total logical CPUs = number of physical CPUs × number of cores per physical CPU. If there is hyper-threading technology, then you can let single-core simulation multi-core work, single core has two threads. Then, the total number of logical CPUs = the number of physical CPUs × the number of cores per physical CPU × the number of hyperthreads.

[core|operating system]

查看内核版本 cat /proc/version | uname -a

查看操作系统 lsb_release -a | cat /etc/redhat-release | cat /etc/issue

[[email protected] EVM_combine]# cat /proc/version 
Linux version 2.6.32-642.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Tue May 10 17:27:01 UTC 2016 
[[email protected] EVM_combine]# uname -a 
Linux tc6000 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 
#cat /proc/version 和uname -a 均可以查看到内核版本为2.6.32-642.el6.x86_64 
#2.6.32 代表版本号 -642代表版本号 
#el6 代表 发行版版本标识,RHEL6CentOS6Oracle Linux6 一般都是el6 
#x86_64 代表64位系统 一般i386代表是32位 
[[email protected] EVM_combine]# lsb_release -a 
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch 
Distributor ID: CentOS 
Description: CentOS release 6.8 (Final) 
Release: 6.8 
Codename: Final 
[[email protected] EVM_combine]# cat /etc/redhat-release 
CentOS release 6.8 (Final) 
[[email protected] EVM_combine]# cat /etc/issue 
CentOS release 6.8 (Final) 
Kernel 
 on an m 
#lsb_release -a cat /etc/redhat-release cat /etc/issue 三个命令都得到操作系统是CentOS, 但这三个命令并不适用每台linux机器