纪录一些linux服务器下查看系统配置的常用命令,系统主要采用CentOS,方便下次查找。
查看系统硬盘各个分区大小以及使用情况:
[root@iZ23kwb30cqZ java]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 1.9G 36G 6% /
tmpfs 499M 0 499M 0% /dev/shm
查看内存信息:
[root@iZ23kwb30cqZ java]# cat /proc/meminfo |more
MemTotal: 1020276 kB
MemFree: 79264 kB
Buffers: 83336 kB
Cached: 706808 kB
查看内存使用量(-M表示用M作为单位):
[root@iZ23kwb30cqZ java]# free -m
total used free shared buffers cached
Mem: 996 919 77 0 81 690
-/+ buffers/cache: 147 849
Swap: 0 0 0
查看CPU具体信息:
[root@iZ23kwb30cqZ java]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 63
model name : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
stepping : 2
cpu MHz : 2494.224
cache size : 30720 KB
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc up rep_good unfair_spinlock pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm xsaveopt
bogomips : 4988.44
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
查看内核/操作系统/CPU概况:
[root@iZ23kwb30cqZ java]# uname -a
Linux iZ23kwb30cqZ 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
查看操作系统信息:
[root@iZ23kwb30cqZ java]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
查看所有的监听端口:
[root@hs-192-168-58-175 ~]# netstat -lnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:44002 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:631 :::* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
tcp 0 0 ::1:6010 :::* LISTEN
tcp 0 0 :::41572 :::* LISTEN
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN
tcp 0 0 :::8009 :::* LISTEN
tcp 0 0 :::111 :::* LISTEN
tcp 0 0 :::8080 :::* LISTEN
查看已安装的软件包:
[root@iZ23kwb30cqZ java]# rpm -qa
python-libs-2.6.6-52.el6.x86_64
basesystem-10.0-4.el6.noarch
bind-libs-9.8.2-0.23.rc1.el6_5.1.x86_64
libproxy-python-0.3.0-4.el6_3.x86_64
ncurses-base-5.7-3.20090208.el6.x86_64
selinux-policy-3.7.19-231.el6_5.3.noarch
libreport-2.0.9-19.el6.centos.x86_64
glib2-2.26.1-7.el6_5.x86_64
查看环境变量:
[root@iZ23kwb30cqZ java]# env
HOSTNAME=iZ23kwb30cqZ
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=61.175.197.70 49788 22
OLDPWD=/usr/local/java/jdk1.8.0_51
SSH_TTY=/dev/pts/0
JRE_HOME=/usr/local/java/jdk1.8.0_51/jre
USER=root