Linux-Common commands for daily system management and Common commands for linux

Source: Internet
Author: User

Linux-Common commands for daily system management and Common commands for linux
1: W view the overall load of the system. You cannot view the specific load, such as memory or disk.23:25:20 up 13 min, 2 users, load average: 0.00, 0.01, 0.01User tty from login @ IDLE JCPU PCPU WHATFlex tty1-0.01 s 0.01 s-bashFlex pts/0 192.168.75.1 0.00 s 0.02 s 0.00 s tmuxThe first line shows the time, system running time, number of login users, cpu load: 1 minute average load, 5 minutes average load, 15 minutes average loadThe load value is normal as long as it does not exceed the number of CPUs2: cat/etc/cpuinfo can view cup Information# Cat/proc/cpuinfo | grep 'processor 'Cpu count# Grep-c 'physical id'/proc/cpuinfo physical cpu count3: vmstat can monitor the system status# Vmstat 1 5 1 second interval output 5 times# Vmstat 1-second interval outputProcs ----------- memory ---------- --- swap -- ----- io ---- system -- ----- cpu -----R B swpd free buff cache si so bi bo in cs us sy id wa st1 0 0 1643624 20552 105072 0 22 1 27 21 0 0 99 1 0Procs: displays Process InformationR indicates the number of processes that run and wait for the cpu time slice. If the number of processes exceeds the number of CPUs, the cpu is insufficient.B indicates the number of processes waiting for resources, io memory, etc. If the length is greater than 1 for a long time, there will be problems.Memory: memory informationSwpd indicates the number of memories switched to the memory partition.Free idle memoryBuffer size of the buff to be written to the diskCache size read from diskSwap: Memory SwitchingData size written into memory in si swap ZoneSo memory data written to the swap ZoneIo: Displays disk usageBi read disk data volumeData volume written to the disk by boSystem: displays the number of interrupts sent during the collection interval.The number of device interruptions observed in a certain time interval per secondNumber of context switches generated by cs per secondCpu: displays the cpu usage statusPercentage of cpu time consumed by usCpu time ratio of sy SystemId CPU idle time ratioWa io wait time ratioThe cpu occupied by st is generally 0.4 top: dynamically monitor the resources occupied by system processes. After a 3-second switch, shift + m is sorted by memory. By 1, the running status of each cpu is displayed.# Top-bn1 is printed at one time, which is often used in shell.Top-00:47:01 up, 2 users, load average: 0.00, 0.00, 0.00Task: 152 total, 1 running, 151 sleeping, 0 stopped, 0 zombieCpu (s): 0.1% us, 0.1% sy, 0.0% ni, 99.8% id, 0.0% wa, 0.0% hi, 0.0% si, 0.0% stMem: 1906900 k total, 268400 k used, 1638500 k free, 22432 k buffersSwap: 2031612 k total, 0 k used, 2031612 k free, 107984 k cached Pid user pr ni virt res shr s % CPU % mem time + COMMAND21 root 20 0 0 0 S 0.3 0.0. 23 events/21478 root 20 0 173 m 8008 4504 S 0.3. 93 vmtoolsd
Load average indicates the system load
Tasks indicates the number of processes.Process List: Focus on RES: memory usage % cpu usage % MEN memory usage5. the sar command can monitor all system resources and print historical information.View network card Traffic# Sar-n DEV# Sar-n DEV 1 5 view Real-time Data Volume once per second#Sar-n DEV 1 view Real-time Data Volume refresh without limit# Sar-n DEV-f/var/log/sa/sa30 view historical data traffic/Var/log/sa/Stores log files12:00:01 am iface rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s12:10:01 AM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.0012:10:01 AM eth0 0.62 0.04 0.04 0.01 0.00 0.00 0.0012:10:01 AM eth1 0.59 0.01 0.04 0.00 0.00 0.00 0.00 Rxpck/s indicates the number of packages received per secondTxpck/s indicates the number of packets sent per second
 RxkB/s data volume received per secondTxkB/s data volume sent per second5. view memory conditions in free modeTotal used free shared buffers cachedMem: 1906900 274296 1632604 232 24268-/+ Buffers/cache: 138796 1768104Swap: 2031612 0 20316126 ps view system process# Ps aux | grep 'tmux'Displays the Process status.User pid % CPU % MEM VSZ RSS TTY STAT START TIME COMMANDFlex 2850 0.0 0.0 23712 1116 pts/0 S + May29 tmuxFlex 2852 0.0 0.1 26528 2068? Ss May29 0: 05 tmuxFlex 4502 0.0 0.0 103308 pts/1 S + grep tmuxPID: The process id kill-9 pid can kill the processSTAT: indicates the Process status.D: process that cannot be interrupted, usually I/OR: indicates a running process.S: indicates a terminal process. Most of the processes are in this state.T: indicates the paused process.S: indicates the master process.+: Process running on the foreground 7 # netstat-lnp print ports started by the System# Netstat-an print the network connection status8 # tcpdump-nn-I eth1Packet capture tool-I is followed by the NIC9 wireshark packet capture tool# Yum install wireshark Installation                 

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.