linux系统信息查询

1.查看内核版本命令:
[root@test asianux-release]# cat /proc/version
Linux version 2.6.9-42.7AXsmp (packager@asianux.com) (gcc version 3.4.6 20060404 (Asianux 2.0 3.4.6-3.1)) #1 SMP Wed Jan 10 11:12:02 EST 2007

 

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值