Top
Show process status in real time
Vmstat 2 3
Server status values, including server CPU usage, memory usage, virtual memory exchange, IO Read and write conditions
Uptime
Commands are used to see how long the server has been running and how many users are logged in to get a quick view of the server's load situation.
View kernel/Os/cpu information
Uname-a
System version
Cat/etc/issue |sed-n ' 1p '
Cpu:
1) View CPU details
Lscpu
Install Yum install-y util-linux-ng
2) View CPU model
Cat/proc/cpuinfo |grep ' model name ' |uniq |awk-f ': ' {print $} '
3) View the number of physical CPUs
Cat/proc/cpuinfo | grep "Physical ID" | Sort | Uniq | Wc-l
4) View the number of logical CPUs
Cat/proc/cpuinfo | grep "Processor" | Wc-l
5) View CPU is a few cores
Cat/proc/cpuinfo |grep "Cores" | Uniq
Memory:
1) details about the memory
Cat/proc/meminfo
2) Approximate memory information
Free-m
Hard disk:
1) hard disk size:
Df-h
2) hard Drive speed measurement
Hdparm-t/dev/hda (IDE hard disk)
Hdparm-t/dev/sda (SATA, SCSI, hard raid card array)
Lsof:
1) show the process of opening file Abc.txt
Lsof Abc.txt
2) Find out who is using the file directory system
Lsof Directory Name
3) See what files the process has opened
Lsof-p $PID
4) View the remote Open network connection
Lsof-i @127.0.0.1
REDIRECT error messages to an empty device
./test.sh 2>/dev/null
REDIRECT standard output to an empty device
./test.sh >/dev/null
Full redirect of standard output and standard error to empty device
./test.sh >/dev/null 2>&1
REDIRECT standard error stderr to standard output stdout
2>&1
To change the file encoding method:
Iconv-f gbk-t utf-8-o outfile infile
-F Original Encoding method
-T Output encoding method
-O indicates the output file name
Linux Basic Information View command