Linux Basic Information View command

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.