首页 > 代码库 > Red Hat Linux常用命令

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 LinuxRed Hat Enterprise Linux Server release 5.5 (Tikanga)

3、查询网卡信息

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

4、查看内存信息

[root@local ~]# cat /proc/meminfo MemTotal:      2057360 kBMemFree:       1145252 kBBuffers:         35588 kBCached:         641836 kBSwapCached:          0 kBActive:         334412 kBInactive:       501312 kBHighTotal:           0 kBHighFree:            0 kBLowTotal:      2057360 kBLowFree:       1145252 kBSwapTotal:     2096440 kBSwapFree:      2096440 kBDirty:            2308 kBWriteback:           0 kBAnonPages:      158340 kBMapped:          70468 kBSlab:            35288 kBPageTables:      14076 kBNFS_Unstable:        0 kBBounce:              0 kBCommitLimit:   3125120 kBCommitted_AS:  1578184 kBVmallocTotal: 34359738367 kBVmallocUsed:    264052 kBVmallocChunk: 34359473911 kBHugePages_Total:     0HugePages_Free:      0HugePages_Rsvd:      0Hugepagesize:     2048 kB

5、查看磁盘信息

[root@local ~]# fdisk -lDisk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = 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 / SolarisDisk /dev/sdb: 2147 MB, 2147483648 bytes255 heads, 63 sectors/track, 261 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb1               1         261     2096451   83  LinuxDisk /dev/sdc: 2147 MB, 2147483648 bytes255 heads, 63 sectors/track, 261 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdc1               1         261     2096451   83  LinuxDisk /dev/sdd: 2147 MB, 2147483648 bytes255 heads, 63 sectors/track, 261 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdd1               1         261     2096451   83  LinuxDisk /dev/sde: 6442 MB, 6442450944 bytes255 heads, 63 sectors/track, 783 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sde1               1         783     6289416   83  LinuxDisk /dev/sdf: 4294 MB, 4294967296 bytes255 heads, 63 sectors/track, 522 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdf1               1         522     4192933+  83  LinuxDisk /dev/sdg: 6442 MB, 6442450944 bytes255 heads, 63 sectors/track, 783 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdg1               1         783     6289416   83  LinuxDisk /dev/sdh: 6442 MB, 6442450944 bytes255 heads, 63 sectors/track, 783 cylindersUnits = 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% /boottmpfs                 2.0G  156M  1.9G   8% /dev/shm

7、查看IP地址

[root@local ~]# ifconfig -aeth0      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)