CPU信息:
CPU型号:
[root@localhost ~]# cat /proc/cpuinfo |grep name|awk -F ':' '{print $2}'|uniq -c 8 Intel(R) Xeon(R) CPU X5650 @ 2.67GHz [root@localhost ~]# cat /proc/cpuinfo |grep name|cut -d ':' -f 2|uniq -c 8 Intel(R) Xeon(R) CPU X5650 @ 2.67GHz [root@localhost ~]#
查看逻辑CPU的个数
[root@localhost logs]# cat /proc/cpuinfo| grep "processor"| wc -l 8 [root@localhost logs]#
查看每个物理CPU中core的个数(即核数)
[root@localhost logs]# cat /proc/cpuinfo| grep "cpu cores"| uniq cpu cores : 4 [root@localhost logs]#
物理CPU个数:
[root@localhost ~]# cat /proc/cpuinfo |grep physical|sort|uniq -c 8 address sizes : 40 bits physical, 48 bits virtual 4 physical id : 0 4 physical id : 1 [root@localhost ~]#
2个4核CPU
总核数 = 物理CPU个数 X 每颗物理CPU的核数
总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数
运行位数:
[root@localhost ~]# getconf LONG_BIT 64 [root@localhost ~]#
当前CPU工作在64位模式下(即操作系统是64位的),如果显示的是32并不表示CPU一定是32位的(64位的也可以当32位的来用),要查看cpu是否支持64bit,方法如下:
[root@localhost ~]# cat /proc/cpuinfo |grep flags|grep "lm"|wc -l 8 [root@localhost ~]#
如果flags中有lm,则表示支持64位,lm的意思是long mode
即如结果大于0, 说明支持64bit处理模式,64位的CPU必须运行在64位的操作系统下,才能实现64位的运算模式。
内存信息:
[root@localhost ~]# cat /proc/meminfo |grep -i mem MemTotal: 8061068 kB MemFree: 7136744 kB Shmem: 388 kB [root@localhost ~]# cat /proc/meminfo |grep Swap SwapCached: 0 kB SwapTotal: 2097144 kB SwapFree: 2097144 kB [root@localhost ~]# free -m total used free shared buffers cached Mem: 7872 1069 6802 0 56 376 -/+ buffers/cache: 637 7234 Swap: 2047 0 2047 [root@localhost ~]#
从上图中可看到当前系统内存总大小为7872(单位是k)已经使用1069,剩余6802。其实真正剩余并不是这个6802,而是第二行的7234,真正使用的也是第二行的637。这是因为系统初始化时,就已经分配出很大一部分内存给缓存,这部分缓存用来随时提供给程序使用,如果程序不用,那这部分内存就空闲。所以,查看内存使用多少,剩余多少请看第二行的数据。另外你还可以加-m 或者-g选项分别以M或G为单位打印内存使用状况。
硬盘信息:
[root@localhost ~]# fdisk -l Disk /dev/sda: 17.2 GB, 17179869184 bytes 255 heads, 63 sectors/track, 2088 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0000e824 Device Boot Start End Blocks Id System /dev/sda1 * 1 13 102400 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 13 274 2097152 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 274 2089 14576640 83 Linux [root@justin ~]# df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sda2 ext4 10321208 4635280 5161640 48% / tmpfs tmpfs 515396 0 515396 0% /dev/shm /dev/sda1 ext4 198337 26679 161418 15% /boot /dev/sda5 ext4 8053168 149244 7494836 2% /home /dev/sdb5 ext3 505572 10543 468927 3% /newdisk [root@justin ~]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda2 ext4 9.9G 4.5G 5.0G 48% / tmpfs tmpfs 504M 0 504M 0% /dev/shm /dev/sda1 ext4 194M 27M 158M 15% /boot /dev/sda5 ext4 7.7G 146M 7.2G 2% /home /dev/sdb5 ext3 494M 11M 458M 3% /newdisk [root@justin ~]#
Swap分区信息:
[root@localhost ~]# swapon -s Filename Type Size Used Priority /dev/sda2 partition 2097144 0 -1 [root@localhost ~]# cat /proc/swaps Filename Type Size Used Priority /dev/sda2 partition 2097144 0 -1 [root@localhost ~]#
UUID:
[root@localhost ~]# blkid /dev/sda3: UUID="eee214fe-4b64-44b6-8b3c-ed0f8e63e32a" TYPE="ext4" /dev/sda1: UUID="fc233792-7e59-487c-8359-a464b7b66097" TYPE="ext4" /dev/sda2: UUID="680ec16a-b4e9-4dc8-8bee-aaf45587e173" TYPE="swap" [root@localhost ~]# ls -l /dev/disk/by-uuid/ total 0 lrwxrwxrwx. 1 root root 10 Dec 6 09:48 680ec16a-b4e9-4dc8-8bee-aaf45587e173 -> ../../sda2 lrwxrwxrwx. 1 root root 10 Dec 6 09:48 eee214fe-4b64-44b6-8b3c-ed0f8e63e32a -> ../../sda3 lrwxrwxrwx. 1 root root 10 Dec 6 09:48 fc233792-7e59-487c-8359-a464b7b66097 -> ../../sda1
补:查看某一文件(夹)大小
[root@localhost src]# du -sh nagios-plugins-1.4.16.tar.gz 2.0M nagios-plugins-1.4.16.tar.gz [root@localhost src]#
查看当前系统安装的软件包数量
[root@justin home]# cat -n /root/install.log|wc -l 1099 [root@justin home]#
网卡信息:
[root@localhost ~]# dmesg |grep -i eth e1000 0000:02:00.0: eth0: (PCI:66MHz:32-bit) 00:50:56:be:47:3b e1000 0000:02:00.0: eth0: Intel(R) PRO/1000 Network Connection e1000 0000:02:02.0: eth1: (PCI:66MHz:32-bit) 00:50:56:96:37:60 e1000 0000:02:02.0: eth1: Intel(R) PRO/1000 Network Connection e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None ADDRCONF(NETDEV_UP): eth0: link is not ready ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None eth0: no IPv6 routers present eth1: no IPv6 routers present [root@localhost ~]#
机器型号:
[root@localhost ~]# dmidecode |grep -i "product name" Product Name: VMware Virtual Platform Product Name: 440BX Desktop Reference Platform [root@localhost ~]#
内核信息:
[root@localhost ~]# uname -r 2.6.32-431.el6.x86_64 [root@localhost ~]# uname -a Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux [root@localhost ~]# uname -i x86_64 [root@localhost ~]#
系统版本信息:
[root@justin ~]# cat /etc/issue Red Hat Enterprise Linux Server release 6.3 (Santiago) Kernel \r on an \m [root@justin ~]# [root@justin ~]# cat /etc/*release Red Hat Enterprise Linux Server release 6.3 (Santiago) Red Hat Enterprise Linux Server release 6.3 (Santiago) [root@justin ~]# [root@justin ~]# cat /etc/*release|sort|uniq -c 2 Red Hat Enterprise Linux Server release 6.3 (Santiago) [root@justin ~]# [root@justin ~]# lsb_release -a LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 6.3 (Santiago) Release: 6.3 Codename: Santiago [root@justin ~]# [root@justin ~]# cat /proc/version Linux version 2.6.32-279.el6.i686 ([email protected]) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Wed Jun 13 18:23:32 EDT 2012 [root@justin ~]# [root@justin ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) [root@justin ~]# [root@justin ~]# rpm -q centos-release package centos-release is not installed [root@justin ~]#
系统支持的文件系统类型:
[root@justin ~]# cat /etc/filesystems ext4 ext3 ext2 nodev proc nodev devpts iso9660 vfat hfs hfsplus [root@justin ~]#
###########################################################
关注微信公众平台,了解最新动态
Linux交流QQ群:333212786
PS:由于学习阶段部分不确定性文章会暂时隐藏,后期会公开,新公开和修正的文章会
通过微信公众平台(justin_rsdd)给出提示,欢迎关注,同时也希望得到大家的指点!
##############################################################