| Guide |
Linux is a magical and efficient operating system, after learning Linux to have a familiar understanding of Linux systems, you need to understand these practical commands to view system information. |
View System version commands
uname
When it comes to the system version, you'll think of uname. View System Kernel version
uname-Parameters
What other-n-m-R parameters are ignored, direct-a
[[Email protected] ~] #uname-alinux linuxprobe.com 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 11:47:41 EST. x86_64 x86_64 x86_64 Gnu/linux[[email protected] ~]#
It seems to be a lot of information from uname, but it doesn't seem like I want it, and there's no version of the system.
lsb_release-a
Red Hat Enterprise Linux Server release 6.4 (Santiago) Release:6.4codename:santiago[[email protected] ~]#
cat/etc/issue
[[Email protected] ~] #cat/etc/issueRed Hat Enterprise Linux Server release 6.4 (Santiago)Kernel \ r on an \m[[ema Il protected] ~]#
View memory-related
Free
When it comes to Linux memory, I think of a command free, which is explained in the Linux commands that novice must master in the 2nd chapter of the textbook.
[Email protected] ~]# free total used free shared buffers cachedMem: 5228872 669360 4559512 0 28060 266936-/+ buffers/cache: 374364 4854508Swap: 4194296 0 4194296[[email protected] ~]# free-m total used free shared Buffers cachedmem: 5106 653 4452 0 260-/+ buffers/cache: 365 4740Swap: 4095 0 4095[[email protected] ~]# free-g total used free shared buffers cachedmem: 4 0 4 0 0 0-/+ buffers/cache: 0 4Swap: 3 0
Obviously memory size, how much to use, how much remains, buffers and cached, and swap conditions at a glance, using parameters-m/-g can specify units
View CPU-related
Uptime
[[email protected] ~]# uptime 20:09:48 up min, 3 users, load average:0.35, 0.25, 0.11 //System average load, 1 min, 5 min Clock, 15 minutes
Top
Real-time monitoring of the system's CPU and memory, default 3s refresh once
[Email protected] ~]# toptop-20:15:41 up min, 3 users, load average:0.41, 0.38, 0.21tasks:236 total, 1 running , 235 sleeping, 0 stopped, 0 zombiecpu (s): 0.2%us, 0.5%sy, 0.0%ni, 98.8%id, 0.5%wa, 0.0%hi, 0.0%si, 0.0%stmem:5228872 K Total, 671136k used, 4557736k free, 28324k buffersswap:4194296k total, 0k used, 4194296k free, 267360k Cached PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND 1 root 20 0 19360 153 6 1224 s 0.0 0.0 0:05.37 init 2 Root 0 0 0 0 S 0.0 0.0 0:00.02 kth Readd 3 root RT 0 0 0 0 S 0.0 0.0 0:00.07 migration/0 4 Root 0 0 0 0 S 0.0 0.0 0:00.14 ksoftirqd/0 5 root RT 0 0 0 0 s 0.0 0.0 0:00.00 migration/0 6 root RT 0 0 0 0 S 0.0 0.0 0:00.01 watchdog/ 0 7 root RT 0 0 0 0 S 0.0 0.0 0:00.69 MIGRATION/1 8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1 9 Root 0 0 0 0 S 0. 0 0.0 0:00.10 ksoftirqd/1 root RT 0 0 0 0 S 0.0 0.0 0:00.00 WATCHDOG/1 Root RT 0 0 0 0 S 0.0 0.0 0:00.10 MIGRATION/2 root RT 0 0 0 0 S 0.0 0.0 0:00.00 MIGRATION/2 Root 0 0 0 0 S 0.0 0.0 0:00.01 KSOFTIRQD/2 Root RT 0 0 0 0 S 0.0 0.0 0:00.00 WATCHDOG/2 Root RT 0 0 0 0 S 0.0 0.0 0:00.17 MIGRATION/3 root RT 0 0 0 0 S 0.0 0 .0 0:00.00 MIGRATION/3 root 0 0 0 0 S 0.0 0.0 0:00.06 KSOFTIRQD/3 Root RT 0 0 0 0 S 0.0 0.0 0:00.00 WATCHDOG/3 Root 20 0 0 0 0 S 0.0 0.0 0:00.41 events/0
CPU memory real-time utilization with this as the standard
View CPU Parameters--Files:/proc/cpuinfo
[Email protected] ~]# cat/proc/cpuinfo | grep "Physical ID" | uniq | wc-l2 //CPU number [[email protected] ~]# Cat/proc/cpuinfo | grep "CPU Cores" | Uniqcpu cores:2 //number of threads [[email protected] ~]# Cat/proc/cpuinfo | grep ' model name ' |uniqmodel Name:inte L (R) Core (TM) i5-3230m CPU @ 2.60GHz //cpu model parameter
view hard disk related
DF
[[email protected] ~]# DF File system 1k-block used available% mount point/dev/sda2 41284928 469040 38718736 2%/ Tmpfs 2614436 224 2614212 1%/dev/shm/dev/sda1 99150 32504 61526 35%/ Boot/dev/sda6 516040 18016 471812 4%/home/dev/sda3 4128448 2542976 1375760 65%/usr[[email protected] ~]# df-h //In a simple way to see the file system capacity has been used with the available percent mount point/dev/sda2 40G 459M 37G 2%/ Tmpfs 2.5G 224K 2.5G 1%/dev/shm/dev/sda1 97M 32M 61M 35%/boot/dev/sda6 504M 18M 461M 4%/home/dev/sda3 4.0G 2.5G 1.4G 65%/usr
fdisk-l
[[email protected] ~]# fdisk-ldisk/dev/sda:107.4 GB, 107374182400 bytes 255 heads, Sectors/track, 13054 cylindersunits = cylinders of 16065 * = 8225280 bytessector size (logical/ph ysical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x000f0739 Device Boot Start End Blocks Id system/dev/sda1 * 1 102400 linuxpartition 1 Doe s not end on cylinder boundary./dev/sda2 5235 41943040 linux/dev/sda3 5235 5757 4194304 linux/dev/sda4 5757 13055 58616832 5 extended/dev/sda5 5757 6280 4194304 swap/solaris/dev/sda6 6280 6345 524288 ;p rotected] ~]# fdisk-l | grep diskdisk/dev/sda:107.4 GB, 107374182400 bytesdisk identifier:0x000f0739[[email protected] ~]#
Iostat view hard disk read and write speed
[Email protected] ~]# IOSTAT-T 1 3//1s once, view 3 timesLinux 2.6.32-358.el6.x86_64 (twj.baidu.com) June 07, 2016 _x86_64_ (4 CPU) June 07, 2016 20:40 03 seconds avg-cpu:%user%nice%syste M%iowait%steal%idle 0.17 0.06 0.74 0.84 0.00 98.19device:tps blk_read/s Blk_ WRTN/S blk_read blk_wrtnsda 8.34 273.82 136.61 1216528 6,069,042,016 June 07 20:40 04 seconds Avg -CPU:%user%nice%system%iowait%steal%idle 0.00 2.10 9.97 13.12 0.00 74.80Device: TPS blk_read/s blk_wrtn/s blk_read blk_wrtnsda 89.00 3472.00 11208.00 3472 11 2,082,016 year June 07 20:40 05 seconds avg-cpu:%user%nice%system%iowait%steal%idle 0.00 1.99 14.35 9.05 0.00 74.61device:tps blk_read/s blk_wrtn/s blk_read blk_wrtnsda 66.13 1464.52 9800.00 1816 12152
Common commands for viewing system information in Linux