Linux System Resource View

Source: Internet
Author: User
Tags dmesg

The following Linux system resources view commands, more commonly used for Vmstat and lsof

    • Vmstat [Refresh delay Refresh Count]
1[Email protected]606: ~$ Vmstat1 52procs-----------Memory-------------Swap-------io-----system--------CPU-----3R b swap free buffer cache si so bi boinchCS US SyIDWA St4  0  0      0 4721680 294340 1586676    0    0     -     -  441  738  4  2 94  1  05  0  0      0 4721556 294348 1586676    0    0     0   280 1391 2388  2  0  the  1  06  0  0      0 4721416 294364 1586676    0    0     0   104 1410 2443  2  1  the  1  07  2  0      0 4721416 294364 1586716    0    0     0     0 2149 3443  2  1  the  0  08  0  0      0 4721416 294364 1586716    0    0     0     0 1430 2393  2  0  the  0  09[Email protected]606:~$

    • DMESG Kernel self-test information
1[Email protected]606: ~$ DMESG |grepCPU2[0.000000] Smpboot:allowing6CPUs,0HotPlug CPUs3[0.000000] Setup_percpu:nr_cpus: theNr_cpumask_bits: theNr_cpu_ids:6Nr_node_ids:14[0.000000] Slub:hwalign= -, order=0-3, minobjects=0, cpus=6, nodes=15[0.000000] RCU restricting CPUs from nr_cpus= theTo nr_cpu_ids=6.6[0.006228] Cpu:physical Processor ID:07[0.006228] Cpu:processor Core ID:08[0.006229] MCE:CPU Supports7MCE Banks9[0.167668] Smpboot:CPU0:AMD FX (tm)-6300Six-core Processor (family:0x15, Model:0x2, Stepping:0x0)Ten[0.168386] NMI watchdog:enabled on all CPUs, permanently consumes one hw-PMU counter. One[0.168474] .... Node #0, CPUs: #1#2#3#4#5 A[0.182597] x86:booted up1Node6CPUs -[1.579348] ledtrig-cpu:registered to indicate activity on CPUs -[1.580211] Microcode:cpu0:patch_level=0x0600081f the[1.580215] Microcode:cpu1:patch_level=0x0600081f -[1.580222] Microcode:cpu2:patch_level=0x0600081f -[1.580228] Microcode:cpu3:patch_level=0x0600081f -[1.580236] Microcode:cpu4:patch_level=0x0600081f +[1.580244] Microcode:cpu5:patch_level=0x0600081f -[Email protected]606:~$
    • Free View Memory
    • Cat/proc/cpuinfo Viewing CPU information
    • Uptime viewing system boot time and average load
    • uname [option]

Options

-A view all relevant information about the system

-R View Kernel version

-S View kernel name

1[Email protected]606:~$uname-a2Linux ucm-aspire-tc-606 4.8.0- --generic # --ubuntu SMP Fri Nov One  -:Geneva: theUtc .x86_64 x86_64 x86_64 gnu/Linux3[Email protected]606:~$uname-R4 4.8.0- --Generic5[Email protected]606:~$uname-s6 Linux7[Email protected]606:~$
    • Determine the number of system bits

The file external command shows how many bits of the command are commands and then knows the number of system bits.

1 [email protected]606file /bin/ls2 /bin/ls-bit LSB executable, x86-1 (SYSV), dynamically linked, interpreter/lib64/ld-linux-x86-  . So. 2  for 2.6. buildid[sha1]=eca98eeadafddff44caf37ae3d4b227132861218, stripped3 [email Protected]606
    • System Release version
1 [email protected]606: ~$ lsb_release-a2No LSB modules is available. 3 Distributor ID:    Ubuntu4 Description:    16.105 Release:    16.106 codename:    yakkety7 [email protected]606
    • List file information that is open or used by the system

lsof [option]

Options

-C string lists only files opened with a process beginning with a string

-u user name lists only files opened by a user's process

-p PID lists files opened by a PID process

eg

Querying files for all process calls in the system

[Email protected]:~$ lsof | More

Query which process is called by a system file

[Email protected]:~$ lsof/sbin/initcommand  PID USER  FD   TYPE DEVICE size/off     NODE namesystemd 1280  UCM txt    REG    8,1  

See which files are called by the httpd process

[Email protected]:~$ lsof-c httpd

Query the file name of a user's process call according to the user name

[Email protected]:~$ lsof-u Root

  

Linux System Resource View

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.