linux系统信息查询命令集

1.查看内核版本命令:
[root@test asianux-release]# cat /proc/version 

2.查看linux系统版本

1)[root@test asianux-release]# lsb_release -a
LSB Version:    3.0
Distributor ID: Asianux
Description:    Asianux release 2.0 (Trinity SP2)
Release:        2.0
Codename:       TrinitySP2

 

2)[root@test etc]# ls -trl /etc/*release*
-rw-r--r--  1 root root 18  8??  5  2005 lsb-release
-rw-r--r--  1 root root 56 11?? 16  2006 redhat-release
-rw-r--r--  1 root root 45 11?? 24  2006 redflag-release
-rw-r--r--  1 root root 33 11?? 24  2006 miraclelinux-release
-rw-r--r--  1 root root 41 11?? 24  2006 haansoft-release
-rw-r--r--  1 root root 34 11?? 30  2006 asianux-release

 

3)[root@test etc]# rpm -q redhat-release
redhat-release-4AS-5.5.1AX

 

3.查看系统是32位还是64
1)[root@test etc]# getconf LONG_BIT
32
[root@test ~]# getconf WORD_BIT
32

 

2)
[root@test etc]# file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped

 

4.查看路由表

[root@test ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0

5.查看打开了哪些端口

[root@test ~]# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:6000                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:113                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:23                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:34220             127.0.0.1:1158              ESTABLISHED
tcp        0      0 127.0.0.1:34216             127.0.0.1:1158              ESTABLISHED
tcp        0      0 127.0.0.1:34153             127.0.0.1:1521              ESTABLISHED
tcp        0      0 127.0.0.1:34218             127.0.0.1:1521              ESTABLISHED
tcp        0      0 127.0.0.1:34201             127.0.0.1:1521              ESTABLISHED
tcp        0      0 :::32768                    :::*                        LISTEN
tcp        0      0 :::3938                     :::*                        LISTEN
tcp        0      0 :::1158                     :::*                        LISTEN
tcp        0      0 :::5520                     :::*                        LISTEN
tcp        0      0 :::6000                     :::*                        LISTEN
tcp        0      0 :::1521                     :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 ::1:34211                   ::1:34210                   TIME_WAIT
tcp        0      0 ::ffff:192.168.1.88:22      ::ffff:192.168.1.54:53041   ESTABLISHED
tcp        0      0 ::ffff:127.0.0.1:1521       ::ffff:127.0.0.1:34153      ESTABLISHED
tcp        0     52 ::ffff:192.168.1.88:22      ::ffff:192.168.1.54:53021   ESTABLISHED
tcp        0      0 ::ffff:127.0.0.1:1521       ::ffff:127.0.0.1:34201      ESTABLISHED
tcp       67      0 ::ffff:127.0.0.1:1158       ::ffff:127.0.0.1:34220      ESTABLISHED
tcp       67      0 ::ffff:127.0.0.1:1158       ::ffff:127.0.0.1:34216      ESTABLISHED
tcp        0      0 ::ffff:127.0.0.1:1521       ::ffff:127.0.0.1:34218      ESTABLISHED
udp        0      0 192.168.1.88:9022           202.103.24.68:53            ESTABLISHED
udp        0    304 192.168.1.88:9024           202.103.44.150:53           ESTABLISHED
udp        0      0 ::1:9003                    :::*
udp        0      0 ::1:9004                    :::*
udp        0      0 ::1:9005                    :::*
udp        0      0 :::9010                     :::*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     65085  /var/tmp/.oracle/s#13317.1
unix  2      [ ACC ]     STREAM     LISTENING     65087  /var/tmp/.oracle/s#13317.2
unix  2      [ ACC ]     STREAM     LISTENING     5914   /tmp/.font-unix/fs7100
unix  2      [ ACC ]     STREAM     LISTENING     7147   /tmp/.X11-unix/X0
unix  2      [ ]         DGRAM                    6010   @/var/run/hal/hotplug_socket
unix  2      [ ACC ]     STREAM     LISTENING     5680   /var/run/acpid.socket
unix  5      [ ]         DGRAM                    5543   /dev/log
unix  2      [ ]         DGRAM                    3141   @udevd
unix  2      [ ACC ]     STREAM     LISTENING     5977   /var/run/dbus/system_bus_socket
unix  2      [ ]         DGRAM                    67520
unix  2      [ ]         STREAM     CONNECTED     67359
unix  3      [ ]         STREAM     CONNECTED     7627   /tmp/.X11-unix/X0
unix  3      [ ]         STREAM     CONNECTED     7626
unix  3      [ ]         STREAM     CONNECTED     7612   /tmp/.font-unix/fs7100
unix  3      [ ]         STREAM     CONNECTED     7611
unix  3      [ ]         STREAM     CONNECTED     7616   /tmp/.X11-unix/X0
unix  3      [ ]         STREAM     CONNECTED     7153
unix  3      [ ]         STREAM     CONNECTED     6009   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     6008
unix  3      [ ]         STREAM     CONNECTED     5980
unix  3      [ ]         STREAM     CONNECTED     5979
unix  2      [ ]         DGRAM                    5842
unix  2      [ ]         DGRAM                    5804
unix  2      [ ]         DGRAM                    5551

查看端口对应的服务

[oracle@test ~]$ cat /etc/services | grep -w "21"
# 21 is registered to ftp, but also used by fsp
ftp             21/tcp
ftp             21/udp          fsp fspd

 

posted @ 2013-05-14 11:29  IT一族  阅读(331)  评论(0编辑  收藏  举报