linux 查看系统信息命令(比较全)


# uname -a # 查看内核/操作系统/CPU信息 
# head -n 1 /etc/issue # 查看操作系统版本 
# cat /proc/cpuinfo # 查看CPU信息 
# hostname # 查看计算机名 
# lspci -tv # 列出所有PCI设备 
# lsusb -tv # 列出所有USB设备 
# lsmod # 列出加载的内核模块 
# env # 查看环境变量资源 
# free -m # 查看内存使用量和交换区使用量 
# df -h # 查看各分区使用情况 
# du -sh <目录名> # 查看指定目录的大小 
# grep MemTotal /proc/meminfo # 查看内存总量 
# grep MemFree /proc/meminfo # 查看空闲内存量 
# uptime # 查看系统运行时间、用户数、负载 
# cat /proc/loadavg # 查看系统负载磁盘和分区 
# mount | column -t # 查看挂接的分区状态 
# fdisk -l # 查看所有分区 
# swapon -s # 查看所有交换分区 
# hdparm -i /dev/hda # 查看磁盘参数(仅适用于IDE设备) 
# dmesg | grep IDE # 查看启动时IDE设备检测状况网络 
# ifconfig # 查看所有网络接口的属性 
# iptables -L # 查看防火墙设置 
# route -n # 查看路由表 
# netstat -lntp # 查看所有监听端口 
# netstat -antp # 查看所有已经建立的连接 
# netstat -s # 查看网络统计信息进程 
# ps -ef # 查看所有进程 
# top # 实时显示进程状态用户 
# w # 查看活动用户 
# id <用户名> # 查看指定用户信息 
# last # 查看用户登录日志 
# cut -d: -f1 /etc/passwd # 查看系统所有用户 
# cut -d: -f1 /etc/group # 查看系统所有组 
# crontab -l # 查看当前用户的计划任务服务 
# chkconfig –list # 列出所有系统服务 
# chkconfig –list | grep on # 列出所有启动的系统服务程序 
# rpm -qa # 查看所有安装的软件包

#查看CPU信息 
[root@localhost ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 94
model name      : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
stepping        : 3
microcode       : 0xbe
cpu MHz         : 2599.946
cache size      : 6144 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
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 ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu 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 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec arat
bogomips        : 5202.00
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 94
model name      : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
stepping        : 3
microcode       : 0xbe
cpu MHz         : 2599.946
cache size      : 6144 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
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 ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu 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 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec arat
bogomips        : 5202.00
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 94
model name      : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
stepping        : 3
microcode       : 0xbe
cpu MHz         : 2599.946
cache size      : 6144 KB
physical id     : 1
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
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 ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu 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 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec arat
bogomips        : 5202.00
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 94
model name      : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
stepping        : 3
microcode       : 0xbe
cpu MHz         : 2599.946
cache size      : 6144 KB
physical id     : 1
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
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 ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu 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 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec arat
bogomips        : 5202.00
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management:

[root@localhost ~]# 


## 列出所有PCI设备 
[root@localhost ~]#  lspci -tv 
-[0000:00]-+-00.0  Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge
           +-01.0-[01]--
           +-07.0  Intel Corporation 82371AB/EB/MB PIIX4 ISA
           +-07.1  Intel Corporation 82371AB/EB/MB PIIX4 IDE
           +-07.3  Intel Corporation 82371AB/EB/MB PIIX4 ACPI
           +-07.7  VMware Virtual Machine Communication Interface
           +-0f.0  VMware SVGA II Adapter
           +-10.0  LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
           +-11.0-[02]--+-00.0  VMware USB1.1 UHCI Controller
           |            +-01.0  Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
           |            +-02.0  Ensoniq ES1371/ES1373 / Creative Labs CT2518
           |            -03.0  VMware USB2 EHCI Controller
           +-15.0-[03]--
           +-15.1-[04]--
           +-15.2-[05]--
           +-15.3-[06]--
           +-15.4-[07]--
           +-15.5-[08]--
           +-15.6-[09]--
           +-15.7-[0a]--
           +-16.0-[0b]--
           +-16.1-[0c]--
           +-16.2-[0d]--
           +-16.3-[0e]--
           +-16.4-[0f]--
           +-16.5-[10]--
           +-16.6-[11]--
           +-16.7-[12]--
           +-17.0-[13]--
           +-17.1-[14]--
           +-17.2-[15]--
           +-17.3-[16]--
           +-17.4-[17]--
           +-17.5-[18]--
           +-17.6-[19]--
           +-17.7-[1a]--
           +-18.0-[1b]--
           +-18.1-[1c]--
           +-18.2-[1d]--
           +-18.3-[1e]--
           +-18.4-[1f]--
           +-18.5-[20]--
           +-18.6-[21]--
           -18.7-[22]--
[root@localhost ~]# 


## 查看计算机名
[root@localhost ~]# hostname
localhost.localdomain
[root@localhost ~]# 
## 列出所有PCI设备 
[root@localhost ~]#  lspci -tv 
-[0000:00]-+-00.0  Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge
           +-01.0-[01]--
           +-07.0  Intel Corporation 82371AB/EB/MB PIIX4 ISA
           +-07.1  Intel Corporation 82371AB/EB/MB PIIX4 IDE
           +-07.3  Intel Corporation 82371AB/EB/MB PIIX4 ACPI
           +-07.7  VMware Virtual Machine Communication Interface
           +-0f.0  VMware SVGA II Adapter
           +-10.0  LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
           +-11.0-[02]--+-00.0  VMware USB1.1 UHCI Controller
           |            +-01.0  Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
           |            +-02.0  Ensoniq ES1371/ES1373 / Creative Labs CT2518
           |            -03.0  VMware USB2 EHCI Controller
           +-15.0-[03]--
           +-15.1-[04]--
           +-15.2-[05]--
           +-15.3-[06]--
           +-15.4-[07]--
           +-15.5-[08]--
           +-15.6-[09]--
           +-15.7-[0a]--
           +-16.0-[0b]--
           +-16.1-[0c]--
           +-16.2-[0d]--
           +-16.3-[0e]--
           +-16.4-[0f]--
           +-16.5-[10]--
           +-16.6-[11]--
           +-16.7-[12]--
           +-17.0-[13]--
           +-17.1-[14]--
           +-17.2-[15]--
           +-17.3-[16]--
           +-17.4-[17]--
           +-17.5-[18]--
           +-17.6-[19]--
           +-17.7-[1a]--
           +-18.0-[1b]--
           +-18.1-[1c]--
           +-18.2-[1d]--
           +-18.3-[1e]--
           +-18.4-[1f]--
           +-18.5-[20]--
           +-18.6-[21]--
           -18.7-[22]--
[root@localhost ~]# 


# lsmod # 列出加载的内核模块 

[root@localhost ~]# lsmod
Module                  Size  Used by
nls_utf8               12557  1
isofs                  39844  1
tcp_lp                 12663  0
rfcomm                 69552  2
fuse                   91874  3
xt_CHECKSUM            12549  1
ipt_MASQUERADE         12678  3
nf_nat_masquerade_ipv4    13412  1 ipt_MASQUERADE
tun                    31621  1
ip6t_rpfilter          12595  1
ipt_REJECT             12541  4
nf_reject_ipv4         13373  1 ipt_REJECT
ip6t_REJECT            12625  2
nf_reject_ipv6         13717  1 ip6t_REJECT
xt_conntrack           12760  12
ip_set                 36439  0
nfnetlink              14696  1 ip_set
ebtable_nat            12807  1
ebtable_broute         12731  1
bridge                136173  1 ebtable_broute
stp                    12976  1 bridge
llc                    14552  2 stp,bridge
ip6table_nat           12864  1
nf_conntrack_ipv6      18935  7
nf_defrag_ipv6         35104  1 nf_conntrack_ipv6
nf_nat_ipv6            14131  1 ip6table_nat
ip6table_mangle        12700  1
ip6table_security      12710  1
ip6table_raw           12683  1
iptable_nat            12875  1
nf_conntrack_ipv4      15053  7
nf_defrag_ipv4         12729  1 nf_conntrack_ipv4
nf_nat_ipv4            14115  1 iptable_nat
nf_nat                 26787  3 nf_nat_ipv4,nf_nat_ipv6,nf_nat_masquerade_ipv4
nf_conntrack          133387  7 nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_ipv4,nf_conntrack_ipv6
iptable_mangle         12695  1
iptable_security       12705  1
iptable_raw            12678  1
ebtable_filter         12827  1
ebtables               35009  3 ebtable_broute,ebtable_nat,ebtable_filter
ip6table_filter        12815  1
ip6_tables             26901  5 ip6table_filter,ip6table_mangle,ip6table_security,ip6table_nat,ip6table_raw
iptable_filter         12810  1
vmw_vsock_vmci_transport    30577  2
vsock                  35327  3 vmw_vsock_vmci_transport
bnep                   19625  2
dm_mirror              22124  0
dm_region_hash         20813  1 dm_mirror
dm_log                 18411  2 dm_region_hash,dm_mirror
dm_mod                123303  2 dm_log,dm_mirror
snd_seq_midi           13565  0
snd_seq_midi_event     14899  1 snd_seq_midi
snd_ens1371            25194  3
iosf_mbi               13523  0
crc32_pclmul           13113  0
ghash_clmulni_intel    13259  0
aesni_intel            69884  0
lrw                    13286  1 aesni_intel
gf128mul               14951  1 lrw
glue_helper            13990  1 aesni_intel
ablk_helper            13597  1 aesni_intel
snd_rawmidi            31294  2 snd_ens1371,snd_seq_midi
snd_ac97_codec        130556  1 snd_ens1371
ac97_bus               12730  1 snd_ac97_codec
snd_seq                62699  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device         14356  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_pcm               106416  2 snd_ac97_codec,snd_ens1371
btusb                  41436  0
btrtl                  12945  1 btusb
btbcm                  14040  1 btusb
btintel                15709  1 btusb
bluetooth             544565  31 bnep,btbcm,btrtl,btusb,rfcomm,btintel
cryptd                 20359  3 ghash_clmulni_intel,aesni_intel,ablk_helper
snd_timer              29822  2 snd_pcm,snd_seq
snd                    83383  13 snd_ac97_codec,snd_timer,snd_pcm,snd_seq,snd_rawmidi,snd_ens1371,snd_seq_device
rfkill                 22391  3 bluetooth
soundcore              15047  1 snd
ppdev                  17671  0
vmw_balloon            18190  0
joydev                 17377  0
nfit                   49183  0
sg                     40721  0
pcspkr                 12718  0
libnvdimm             132047  1 nfit
parport_pc             28165  0
parport                42299  2 ppdev,parport_pc
i2c_piix4              22390  0
shpchp                 37032  0
vmw_vmci               67013  1 vmw_vsock_vmci_transport
nfsd                  342857  1
auth_rpcgss            59415  1 nfsd
nfs_acl                12837  1 nfsd
lockd                  93827  1 nfsd
grace                  13515  2 nfsd,lockd
sunrpc                348674  7 nfsd,auth_rpcgss,lockd,nfs_acl
ip_tables              27115  5 iptable_security,iptable_filter,iptable_mangle,iptable_nat,iptable_raw
xfs                   978100  1
libcrc32c              12644  3 xfs,nf_nat,nf_conntrack
sr_mod                 22416  1
sd_mod                 46322  3
cdrom                  42556  1 sr_mod
crc_t10dif             12714  1 sd_mod
crct10dif_generic      12647  0
ata_generic            12910  0
pata_acpi              13038  0
vmwgfx                235405  2
drm_kms_helper        159169  1 vmwgfx
syscopyarea            12529  1 drm_kms_helper
sysfillrect            12701  1 drm_kms_helper
sysimgblt              12640  1 drm_kms_helper
fb_sys_fops            12703  1 drm_kms_helper
ttm                    99345  1 vmwgfx
ata_piix               35038  1
libata                238896  3 pata_acpi,ata_generic,ata_piix
drm                   370825  5 ttm,drm_kms_helper,vmwgfx
crct10dif_pclmul       14289  1
crct10dif_common       12595  3 crct10dif_pclmul,crct10dif_generic,crc_t10dif
crc32c_intel           22079  1
mptspi                 22542  2
e1000                 137500  0
scsi_transport_spi     30732  1 mptspi
serio_raw              13413  0
mptscsih               40150  1 mptspi
mptbase               105960  2 mptspi,mptscsih
i2c_core               40756  3 drm,i2c_piix4,drm_kms_helper
[root@localhost ~]# 
# # 列出所有USB设备 
[root@localhost ~]# lsusb -tv 
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/7p, 12M
        |__ Port 1: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 1: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
[root@localhost ~]# 
# env # 查看环境变量资源 
[root@localhost ~]# env 
XDG_SESSION_ID=16
HOSTNAME=localhost.localdomain
SELINUX_ROLE_REQUESTED=
TERM=vt100
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=192.168.1.103 59426 22
SELINUX_USE_CURRENT_RANGE=
SSH_TTY=/dev/pts/1
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
MAIL=/var/spool/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
PWD=/root
LANG=en_US.UTF-8
SELINUX_LEVEL_REQUESTED=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
LOGNAME=root
XDG_DATA_DIRS=/root/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/
SSH_CONNECTION=192.168.1.103 59426 192.168.1.100 22
LESSOPEN=||/usr/bin/lesspipe.sh %s
XDG_RUNTIME_DIR=/run/user/0
_=/usr/bin/env
[root@localhost ~]# 
#查看操作系统版本 
[root@localhost ~]# head -n 1 /etc/issue 
S


#  # 查看内存使用量和交换区使用量 

[root@localhost ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3774         831         104          12        2839        2617
Swap:         10239           0       10239
[root@localhost ~]# 
# # 查看各分区使用情况 

[root@localhost ~]# df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2      1014G   14G 1000G   2% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  9.0M  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           378M   36K  378M   1% /run/user/0
/dev/sr0        8.1G  8.1G     0 100% /run/media/root/CentOS 7 x86_64
[root@localhost ~]# 
# du -sh <目录名> # 查看指定目录的大小 

[root@localhost ~]# du -sh 
8.2G    .
[root@localhost ~]# 
# grep MemTotal /proc/meminfo # 查看内存总量 

[root@localhost ~]# grep MemTotal /proc/meminfo 
MemTotal:        3865308 kB
[root@localhost ~]# 
# uptime # 查看系统运行时间、用户数、负载 
[root@localhost ~]# uptime
 10:55:36 up  2:49,  3 users,  load average: 0.00, 0.02, 0.07
[root@localhost ~]#


# cat /proc/loadavg # 查看系统负载磁盘和分区 

[root@localhost ~]# cat /proc/loadavg
0.00 0.02 0.06 2/433 43398
[root@localhost ~]#
# mount | column -t # 查看挂接的分区状态 
[root@localhost ~]#  mount | column -t 
sysfs       on  /sys                             type  sysfs            (rw,nosuid,nodev,noexec,relatime,seclabel)
proc        on  /proc                            type  proc             (rw,nosuid,nodev,noexec,relatime)
devtmpfs    on  /dev                             type  devtmpfs         (rw,nosuid,seclabel,size=1917916k,nr_inodes=479479,mode=755)
securityfs  on  /sys/kernel/security             type  securityfs       (rw,nosuid,nodev,noexec,relatime)
tmpfs       on  /dev/shm                         type  tmpfs            (rw,nosuid,nodev,seclabel)
devpts      on  /dev/pts                         type  devpts           (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs       on  /run                             type  tmpfs            (rw,nosuid,nodev,seclabel,mode=755)
tmpfs       on  /sys/fs/cgroup                   type  tmpfs            (ro,nosuid,nodev,noexec,seclabel,mode=755)
cgroup      on  /sys/fs/cgroup/systemd           type  cgroup           (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore      on  /sys/fs/pstore                   type  pstore           (rw,nosuid,nodev,noexec,relatime)
cgroup      on  /sys/fs/cgroup/perf_event        type  cgroup           (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup      on  /sys/fs/cgroup/devices           type  cgroup           (rw,nosuid,nodev,noexec,relatime,devices)
cgroup      on  /sys/fs/cgroup/cpu,cpuacct       type  cgroup           (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup      on  /sys/fs/cgroup/freezer           type  cgroup           (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup      on  /sys/fs/cgroup/net_cls,net_prio  type  cgroup           (rw,nosuid,nodev,noexec,relatime,net_prio,net_cls)
cgroup      on  /sys/fs/cgroup/hugetlb           type  cgroup           (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup      on  /sys/fs/cgroup/memory            type  cgroup           (rw,nosuid,nodev,noexec,relatime,memory)
cgroup      on  /sys/fs/cgroup/pids              type  cgroup           (rw,nosuid,nodev,noexec,relatime,pids)
cgroup      on  /sys/fs/cgroup/cpuset            type  cgroup           (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup      on  /sys/fs/cgroup/blkio             type  cgroup           (rw,nosuid,nodev,noexec,relatime,blkio)
configfs    on  /sys/kernel/config               type  configfs         (rw,relatime)
/dev/sda2   on  /                                type  xfs              (rw,relatime,seclabel,attr2,inode64,noquota)
selinuxfs   on  /sys/fs/selinux                  type  selinuxfs        (rw,relatime)
systemd-1   on  /proc/sys/fs/binfmt_misc         type  autofs           (rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14056)
debugfs     on  /sys/kernel/debug                type  debugfs          (rw,relatime)
hugetlbfs   on  /dev/hugepages                   type  hugetlbfs        (rw,relatime,seclabel)
mqueue      on  /dev/mqueue                      type  mqueue           (rw,relatime,seclabel)
nfsd        on  /proc/fs/nfsd                    type  nfsd             (rw,relatime)
sunrpc      on  /var/lib/nfs/rpc_pipefs          type  rpc_pipefs       (rw,relatime)
tmpfs       on  /run/user/0                      type  tmpfs            (rw,nosuid,nodev,relatime,seclabel,size=386532k,mode=700)
gvfsd-fuse  on  /run/user/0/gvfs                 type  fuse.gvfsd-fuse  (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
fusectl     on  /sys/fs/fuse/connections         type  fusectl          (rw,relatime)
/dev/sr0    on  /run/media/root/CentOS           7     x86_64           type                                                                                                       iso9660  (ro,nosuid,nodev,relatime,uid=0,gid=0,iocharset=utf8,mode=0400,dmode=0500,uhelper=udisks2)
[root@localhost ~]#


# fdisk -l # 查看所有分区 

[root@localhost ~]# fdisk -l 

Disk /dev/sda: 1099.5 GB, 1099511627776 bytes, 2147483648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000c868b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    20973567    10485760   82  Linux swap / Solaris
/dev/sda2   *    20973568  2147483647  1063255040   83  Linux
[root@localhost ~]# 


# swapon -s # 查看所有交换分区 

[root@localhost ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda1                               partition       10485756        0       -1
[root@localhost ~]# 


# dmesg | grep IDE # 查看启动时IDE设备检测状况网络 

[root@localhost ~]# dmesg | grep IDE 
[    4.069928] pci 0000:00:07.1: legacy IDE quirk: reg 0x10: [io  0x01f0-0x01f7]
[    4.069933] pci 0000:00:07.1: legacy IDE quirk: reg 0x14: [io  0x03f6]
[    4.069935] pci 0000:00:07.1: legacy IDE quirk: reg 0x18: [io  0x0170-0x0177]
[    4.069937] pci 0000:00:07.1: legacy IDE quirk: reg 0x1c: [io  0x0376]
[   15.840403] ata2.00: ATAPI: VMware Virtual IDE CDROM Drive, 00000001, max UDMA/33
[   15.886604] scsi 1:0:0:0: CD-ROM            NECVMWar VMware IDE CDR10 1.00 PQ: 0 ANSI: 5
[   15.995785] scsi target2:0:0: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)
[root@localhost ~]# 


# iptables -L # 查看防火墙设置 


[root@localhost ~]# iptables -L 
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere
INPUT_direct  all  --  anywhere             anywhere
INPUT_ZONES_SOURCE  all  --  anywhere             anywhere
INPUT_ZONES  all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere             ctstate INVALID
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             192.168.122.0/24     ctstate RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere
FORWARD_direct  all  --  anywhere             anywhere
FORWARD_IN_ZONES_SOURCE  all  --  anywhere             anywhere
FORWARD_IN_ZONES  all  --  anywhere             anywhere
FORWARD_OUT_ZONES_SOURCE  all  --  anywhere             anywhere
FORWARD_OUT_ZONES  all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere             ctstate INVALID
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc
OUTPUT_direct  all  --  anywhere             anywhere

Chain FORWARD_IN_ZONES (1 references)
target     prot opt source               destination
FWDI_public  all  --  anywhere             anywhere            [goto]
FWDI_public  all  --  anywhere             anywhere            [goto]

Chain FORWARD_IN_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain FORWARD_OUT_ZONES (1 references)
target     prot opt source               destination
FWDO_public  all  --  anywhere             anywhere            [goto]
FWDO_public  all  --  anywhere             anywhere            [goto]

Chain FORWARD_OUT_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain FORWARD_direct (1 references)
target     prot opt source               destination

Chain FWDI_public (2 references)
target     prot opt source               destination
FWDI_public_log  all  --  anywhere             anywhere
FWDI_public_deny  all  --  anywhere             anywhere
FWDI_public_allow  all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere

Chain FWDI_public_allow (1 references)
target     prot opt source               destination

Chain FWDI_public_deny (1 references)
target     prot opt source               destination

Chain FWDI_public_log (1 references)
target     prot opt source               destination

Chain FWDO_public (2 references)
target     prot opt source               destination
FWDO_public_log  all  --  anywhere             anywhere
FWDO_public_deny  all  --  anywhere             anywhere
FWDO_public_allow  all  --  anywhere             anywhere

Chain FWDO_public_allow (1 references)
target     prot opt source               destination

Chain FWDO_public_deny (1 references)
target     prot opt source               destination

Chain FWDO_public_log (1 references)
target     prot opt source               destination

Chain INPUT_ZONES (1 references)
target     prot opt source               destination
IN_public  all  --  anywhere             anywhere            [goto]
IN_public  all  --  anywhere             anywhere            [goto]

Chain INPUT_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain INPUT_direct (1 references)
target     prot opt source               destination

Chain IN_public (2 references)
target     prot opt source               destination
IN_public_log  all  --  anywhere             anywhere
IN_public_deny  all  --  anywhere             anywhere
IN_public_allow  all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere

Chain IN_public_allow (1 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh ctstate NEW

Chain IN_public_deny (1 references)
target     prot opt source               destination

Chain IN_public_log (1 references)
target     prot opt source               destination

Chain OUTPUT_direct (1 references)
target     prot opt source               destination
[root@localhost ~]# 
# route -n # 查看路由表 

[root@localhost ~]# route -n 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 ens33
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 ens33
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
[root@localhost ~]# 


# netstat -lntp # 查看所有监听端口 

[root@localhost ~]# netstat -lntp 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1379/dnsmasq
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      989/sshd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      992/cupsd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1250/master
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd
tcp6       0      0 :::22                   :::*                    LISTEN      989/sshd
tcp6       0      0 ::1:631                 :::*                    LISTEN      992/cupsd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1250/master
[root@localhost ~]# 


# 查看所有已经建立的连接 

[root@localhost ~]# netstat -antp 
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1379/dnsmasq
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      989/sshd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      992/cupsd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1250/master
tcp        0      0 192.168.1.100:22        192.168.1.107:61500     ESTABLISHED 2368/sshd: root@pts
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd
tcp6       0      0 :::22                   :::*                    LISTEN      989/sshd
tcp6       0      0 ::1:631                 :::*                    LISTEN      992/cupsd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1250/master
[root@localhost ~]# 



# netstat -s # 查看网络统计信息进程 

[root@localhost ~]# netstat -s
Ip:
    182 total packets received
    0 forwarded
    0 incoming packets discarded
    140 incoming packets delivered
    160 requests sent out
Icmp:
    5 ICMP messages received
    0 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 5
    6 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 6
IcmpMsg:
        InType3: 5
        OutType3: 6
Tcp:
    0 active connections openings
    1 passive connection openings
    0 failed connection attempts
    0 connection resets received
    1 connections established
    123 segments received
    99 segments send out
    0 segments retransmited
    0 bad segments received.
    0 resets sent
Udp:
    7 packets received
    5 packets to unknown port received.
    0 packet receive errors
    52 packets sent
    0 receive buffer errors
    0 send buffer errors
UdpLite:
TcpExt:
    2 delayed acks sent
    27 packet headers predicted
    24 acknowledgments not containing data payload received
    45 predicted acknowledgments
    IPReversePathFilter: 1
    TCPAutoCorking: 1
    TCPOrigDataSent: 92
IpExt:
    InMcastPkts: 40
    OutMcastPkts: 44
    InOctets: 17509
    OutOctets: 28490
    InMcastOctets: 5622
    OutMcastOctets: 6039
    InNoECTPkts: 182
[root@localhost ~]# 
原文地址:https://www.cnblogs.com/ios9/p/9741910.html