Red Hat Linux常用命令

1、查看机器型号

[root@local ~]# dmidecode | grep "Product Name"
        Product Name: VMware Virtual Platform
        Product Name: 440BX Desktop Reference Platform

2、查询Linux发行版本

[root@local ~]# cat /etc/issue | grep Linux
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

3、查询网卡信息

[root@local ~]# dmesg | grep -i eth
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
eth0: no IPv6 routers present

4、查看内存信息

[root@local ~]# cat /proc/meminfo 
MemTotal:      2057360 kB
MemFree:       1145252 kB
Buffers:         35588 kB
Cached:         641836 kB
SwapCached:          0 kB
Active:         334412 kB
Inactive:       501312 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:      2057360 kB
LowFree:       1145252 kB
SwapTotal:     2096440 kB
SwapFree:      2096440 kB
Dirty:            2308 kB
Writeback:           0 kB
AnonPages:      158340 kB
Mapped:          70468 kB
Slab:            35288 kB
PageTables:      14076 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   3125120 kB
Committed_AS:  1578184 kB
VmallocTotal: 34359738367 kB
VmallocUsed:    264052 kB
VmallocChunk: 34359473911 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

5、查看磁盘信息

[root@local ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2350    18771952+  83  Linux
/dev/sda3            2351        3655    10482412+  83  Linux
/dev/sda4            3656        3916     2096482+   5  Extended
/dev/sda5            3656        3916     2096451   82  Linux swap / Solaris

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         261     2096451   83  Linux

Disk /dev/sdc: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         261     2096451   83  Linux

Disk /dev/sdd: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         261     2096451   83  Linux

Disk /dev/sde: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1         783     6289416   83  Linux

Disk /dev/sdf: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         522     4192933+  83  Linux

Disk /dev/sdg: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1         783     6289416   83  Linux

Disk /dev/sdh: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1               1         783     6289416   83  Linux

6、查看已挂载分区情况

[root@local ~]# df -lh
文件系统              容量  已用 可用 已用% 挂载点
/dev/sda2              18G   15G  2.5G  86% /
/dev/sda3             9.7G  3.2G  6.1G  34% /tmp
/dev/sda1              99M   15M   80M  16% /boot
tmpfs                 2.0G  156M  1.9G   8% /dev/shm

7、查看IP地址

[root@local ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:0C:29:66:A7:7A  
          inet addr:192.168.163.200  Bcast:192.168.163.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe66:a77a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2764 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1315 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:423897 (413.9 KiB)  TX bytes:226241 (220.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4205 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4205 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2593323 (2.4 MiB)  TX bytes:2593323 (2.4 MiB)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric: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:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Red Hat Linux常用命令,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。