linux硬件检测

2017-01-05 11:08:35来源:oschina作者:wzl_up人点击

1 网络


mull


ifconfig


[root@wangzilong Downloads]# ifconfig
eth0Link encap:Ethernet(封装接口)HWaddr F0:DE:F1:CF:E2:EE
inet addr:172.16.100.18Bcast:172.16.100.255Mask:255.255.255.0
inet6 addr: fe80::f2de:f1ff:fecf:e2ee/64 Scope:Link
UP BROADCAST RUNNING MULTICASTMTU:1500(最大传输单元)Metric:1
RX packets:35025(接收的包) errors:0 dropped:0 overruns:0 frame:0
TX packets:20299 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19266949 (18.3 MiB)TX bytes:2253024 (2.1 MiB)
Interrupt:20 Memory:f2500000-f2520000
lo Link encap:Local Loopback
inet addr:127.0.0.1Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNINGMTU:65536Metric:1
RX packets:2558 errors:0 dropped:0 overruns:0 frame:0
TX packets:2558 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:195312 (190.7 KiB)TX bytes:195312 (190.7 KiB)
wlan0 Link encap:EthernetHWaddr 10:0B:A9:8D:F0:C4
UP BROADCAST MULTICASTMTU:1500Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b)TX bytes:0 (0.0 b)

ping


[root@wangzilong ~]# ping www.baidu.com
PING www.a.shifen.com (180.97.33.107) 56(84) bytes of data.
64 bytes from 180.97.33.107: icmp_seq=1 ttl=53 time=42.3 ms
64 bytes from 180.97.33.107: icmp_seq=2 ttl=53 time=42.7 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 10594ms
rtt min/avg/max/mdev = 42.330/42.553/42.777/0.304 ms
# 表示拼通

telnet:ip:port


[root@wangzilong ~]# telnet www.baid.com 80
Trying 122.10.91.48...
Connected to www.baid.com.
Escape character is '^]'.
^C^C
Connection closed by foreign host.
#出现Escape character 表示端口畅通

常用的端口:


443:https 加密


80:web服务端口


20/21:ftp服务


22:ssh服务


25:smtp


3306:mysql


1521:oracle监听


netstat:通过端口查服务


[root@wangzilong ~]# netstat -anutlp|grep 1521
tcp 00 :::1521 :::* LISTEN3122/tnslsnr
# 表示查询得知1521是oracle的监听端口

查看启动地址:


ll /proc/pid


lsof -p pid


[root@wangzilong ~]# ll /proc/4472
total 0
dr-xr-xr-x 2 root root 0 Jan4 10:17 attr
-rw-r--r-- 1 root root 0 Jan4 10:17 autogroup
-r-------- 1 root root 0 Jan4 10:17 auxv
-r--r--r-- 1 root root 0 Jan4 10:17 cgroup
--w------- 1 root root 0 Jan4 10:17 clear_refs
-r--r--r-- 1 root root 0 Jan4 10:17 cmdline
-rw-r--r-- 1 root root 0 Jan4 10:17 comm
-rw-r--r-- 1 root root 0 Jan4 10:17 coredump_filter
-r--r--r-- 1 root root 0 Jan4 10:17 cpuset
lrwxrwxrwx 1 root root 0 Jan4 10:17 cwd -> /root
-r-------- 1 root root 0 Jan4 10:17 environ
lrwxrwxrwx 1 root root 0 Jan4 10:17 exe -> /bin/bash # 有exe的就是
dr-x------ 2 root root 0 Jan4 10:07 fd
dr-x------ 2 root root 0 Jan4 10:17 fdinfo
-r-------- 1 root root 0 Jan4 10:17 io
-rw------- 1 root root 0 Jan4 10:17 limits
-rw-r--r-- 1 root root 0 Jan4 10:17 loginuid
-r--r--r-- 1 root root 0 Jan4 10:17 maps
-rw------- 1 root root 0 Jan4 10:17 mem
-r--r--r-- 1 root root 0 Jan4 10:17 mountinfo
-r--r--r-- 1 root root 0 Jan4 10:17 mounts
-r-------- 1 root root 0 Jan4 10:17 mountstats
dr-xr-xr-x 6 root root 0 Jan4 10:17 net
dr-x--x--x 2 root root 0 Jan4 10:17 ns
-r--r--r-- 1 root root 0 Jan4 10:17 numa_maps
-rw-r--r-- 1 root root 0 Jan4 10:17 oom_adj
-r--r--r-- 1 root root 0 Jan4 10:17 oom_score
-rw-r--r-- 1 root root 0 Jan4 10:17 oom_score_adj
-r--r--r-- 1 root root 0 Jan4 10:17 pagemap
-r--r--r-- 1 root root 0 Jan4 10:17 personality
lrwxrwxrwx 1 root root 0 Jan4 10:17 root -> /
-rw-r--r-- 1 root root 0 Jan4 10:17 sched
-r--r--r-- 1 root root 0 Jan4 10:17 schedstat
-r--r--r-- 1 root root 0 Jan4 10:17 sessionid
-r--r--r-- 1 root root 0 Jan4 10:17 smaps
-r--r--r-- 1 root root 0 Jan4 10:17 stack
-r--r--r-- 1 root root 0 Jan4 10:17 stat
-r--r--r-- 1 root root 0 Jan4 10:17 statm
-r--r--r-- 1 root root 0 Jan4 10:17 status
-r--r--r-- 1 root root 0 Jan4 10:17 syscall
dr-xr-xr-x 3 root root 0 Jan4 10:17 task
-r--r--r-- 1 root root 0 Jan4 10:17 wchan

2 cpu


top


uptime


3 内存


free


4 disk


df -h


vmstat


5 综合


iostat


sar


vmstat


dstat


6 系统进程


ps -ef


7 环境变量


printenv


[root@wangzilong ~]# printenv
ORBIT_SOCKETDIR=/tmp/orbit-root
HOSTNAME=wangzilong
IMSETTINGS_INTEGRATE_DESKTOP=yes
GIO_LAUNCHED_DESKTOP_FILE_PID=4470
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=8abace0adf0c13df45730ce000000022-1483495484.612039-2115522258
HISTSIZE=1000
GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc-1.2-gnome2
WINDOWID=54525955
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
IMSETTINGS_MODULE=IBus
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:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=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:*.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:
GNOME_KEYRING_SOCKET=/tmp/keyring-CWzJtI/socket
SSH_AUTH_SOCK=/tmp/keyring-CWzJtI/socket.ssh
SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/4048,unix/unix:/tmp/.ICE-unix/4048
USERNAME=root
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/gnome-terminal.desktop
DESKTOP_SESSION=gnome
MAIL=/var/spool/mail/root
PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/java/jdk1.8.0_111/bin:/root/bin
QT_IM_MODULE=ibus
PWD=/root
JAVA_HOME=/usr/java/jdk1.8.0_111
XMODIFIERS=@im=ibus
GDM_KEYBOARD_LAYOUT=us
LANG=en_US.UTF-8
GNOME_KEYRING_PID=4038
GDM_LANG=en_US.UTF-8
GDMSESSION=gnome
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HISTCONTROL=ignoredups
HOME=/root
SHLVL=2
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=root
QTLIB=/usr/lib64/qt-3.3/lib
CVS_RSH=ssh
CLASSPATH=/usr/java/jdk1.8.0_111/lib/dt.jar:/usr/java/jdk1.8.0_111/lib/tools.jar
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-0IUkzQUCRk,guid=0bfd76ac415c0b92e190a87200000935
LESSOPEN=|/usr/bin/lesspipe.sh %s
WINDOWPATH=1
DISPLAY=:0.0
G_BROKEN_FILENAMES=1
XAUTHORITY=/var/run/gdm/auth-for-root-YDta6g/database
COLORTERM=gnome-terminal
_=/usr/bin/printenv

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台