Common commands for viewing system information in Linux
GuideLinux is a magical and efficient operating system. After learning about Linux, you need to understand these useful commands for viewing system information.View System Version commandsUname
When talking about the system version, you will surely think of uname to view the system kernel version.
Uname-Parameter
Other-n-m-r parameters are ignored.
[root@linuxprobe ~]#uname -aLinux linuxprobe.com 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux[root@linuxprobe ~]#
Uname seems to have seen a lot of information, but it does not seem to be what I want. No System Version
Lsb_release-[root@linuxprobe ~]# lsb_release -aLSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarchDistributor ID: RedHatEnterpriseServerDescription: Red Hat Enterprise Linux Server release 6.4 (Santiago)Release: 6.4Codename: Santiago[root@linuxprobe ~]#
Cat/etc/issue[root@linuxprobe ~]#cat /etc/issueRed Hat Enterprise Linux Server release 6.4 (Santiago)Kernel \r on an \m[root@linuxprobe ~]#
View memory problemsFreeWhen talking about Linux memory, I think of a command free, which is explained in the Linux commands that beginners must master in Chapter 1 of the textbook.
[root@linuxprobe ~]# free total used free shared buffers cachedMem: 5228872 669360 4559512 0 28060 266936-/+ buffers/cache: 374364 4854508Swap: 4194296 0 4194296[root@linuxprobe ~]# free -m total used free shared buffers cachedMem: 5106 653 4452 0 27 260-/+ buffers/cache: 365 4740Swap: 4095 0 4095[root@linuxprobe ~]# free -g total used free shared buffers cachedMem: 4 0 4 0 0 0-/+ buffers/cache: 0 4Swap: 3 0 3[root@linuxprobe ~]#
Obviously, the memory size, usage, remaining amount, buffers and cached values, and swap conditions are clear at a glance. The unit can be specified using the-m/-g parameter.
View cpu ProblemsUptime[Root @ linuxprobe ~] # Uptime 20:09:48 up 43 min, 3 users, load average: 0.35, 0.25, 0.11 // average system load, 1 minute, 5 minutes, 15 minutes
TopThe cpu and memory of the real-time monitoring system are refreshed once every 3 seconds by default.
[root@linuxprobe ~]# toptop - 20:15:41 up 49 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: 5228872k 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 1536 1224 S 0.0 0.0 0:05.37 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd 3 root RT 0 0 0 0 S 0.0 0.0 0:00.07 migration/0 4 root 20 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 20 0 0 0 0 S 0.0 0.0 0:00.10 ksoftirqd/1 10 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/1 11 root RT 0 0 0 0 S 0.0 0.0 0:00.10 migration/2 12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/2 13 root 20 0 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/2 14 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/2 15 root RT 0 0 0 0 S 0.0 0.0 0:00.17 migration/3 16 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/3 17 root 20 0 0 0 0 S 0.0 0.0 0:00.06 ksoftirqd/3 18 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/3 19 root 20 0 0 0 0 S 0.0 0.0 0:00.41 events/0
Cpu memory real-time usage as the standard
View cpu parameters -- file:/proc/cpuinfo[Root @ linuxprobe ~] # Cat/proc/cpuinfo | grep "physical id" | uniq | wc-l2 // Number of CPUs [root @ linuxprobe ~] # Cat/proc/cpuinfo | grep "cpu cores" | uniqcpu cores: 2 // Number of threads [root @ linuxprobe ~] # Cat/proc/cpuinfo | grep 'model name' | uniqmodel name: Intel (R) Core (TM) i5-3230M CPU @ 2.60 GHz // cpu model Parameters
View hard disk ProblemsDf[Root @ linuxprobe ~] # Df file system 1 K-block used available % mount point/dev/sda2 41284928 469040 38718736 2%/tmpfs 2614436 224 2614212 1% 99150/dev/shm/dev/sda1 32504 61526 35% /boot/dev/sda6 516040 18016 471812 4%/home/dev/sda3 4128448 2542976 1375760 65%/usr [root @ linuxprobe ~] # Df-h // display the file system capacity in use in a simple and understandable way % mount point/dev/sda2 40G 459 M 37G 2%/tmpfs 2.5G 224 K 2.5G 1%/dev/shm/dev/sda1 97 M 32 M 61 M 35%/boot/dev/sda6 504 M 18 M 461 M 4%/home/dev/sda3 4.0G 2.5G 1.4G 65%/usr
Fdisk-l[root@linuxprobe ~]# fdisk -lDisk /dev/sda: 107.4 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000f0739 Device Boot Start End Blocks Id System/dev/sda1 * 1 13 102400 83 LinuxPartition 1 does not end on cylinder boundary./dev/sda2 13 5235 41943040 83 Linux/dev/sda3 5235 5757 4194304 83 Linux/dev/sda4 5757 13055 58616832 5 Extended/dev/sda5 5757 6280 4194304 82 Linux swap / Solaris/dev/sda6 6280 6345 524288 83 Linux[root@linuxprobe ~]# fdisk -l | grep DiskDisk /dev/sda: 107.4 GB, 107374182400 bytesDisk identifier: 0x000f0739[root@linuxprobe ~]#
Iostat view hard disk read/write speed[Root @ linuxprobe ~] # Iostat-t 1 3 // 1 s, check 3 times Linux 2.6.32-358. el6.x86 _ 64 (twj.baidu.com) February 12 _ x86_64 _ (4 CPU) February 20: 40 minutes 03 seconds avg-cpu: % user % nice % system % iowait % steal % idle 0.17 0.06 0.74 0.84 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtnsda 8.34 273.82 136.61 1216528 6069042016--May 23, 04 seconds avg-cpu: % user % nice % system % iowait % steal % idle 0.00 2.10 9.97 13.12 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtnsda 89.00 3472.00 11208.00 3472 112082016 at 20 o'clock on January 1, June 07 minutes avg-cpu: % user % nice % system % iowait % steal % idle 0.00 1.99 14.35 9.05 0.00 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtnsda 74.61 66.13 1464.52 9800.00
Address: http://www.linuxprobe.com/linux-cat-system.html