Linux操作系統(tǒng)查看系統(tǒng)信息命令
Linux操作系統(tǒng)的系統(tǒng)信息我們可以通過命令來查看到。下面由學(xué)習(xí)啦小編為大家整理了Linux操作系統(tǒng)查看系統(tǒng)信息的命令的相關(guān)知識(shí),希望對(duì)大家有幫助!
Linux操作系統(tǒng)查看系統(tǒng)信息常用命令
# uname -a # 查看內(nèi)核/操作系統(tǒng)/CPU信息
# head -n 1 /etc/issue # 查看操作系統(tǒng)版本
# cat /proc/cpuinfo # 查看CPU信息
# hostname # 查看計(jì)算機(jī)名
# lspci -tv # 列出所有PCI設(shè)備
# lsusb -tv # 列出所有USB設(shè)備
# lsmod # 列出加載的內(nèi)核模塊
# env # 查看環(huán)境變量資源
# free -m # 查看內(nèi)存使用量和交換區(qū)使用量
# df -h # 查看各分區(qū)使用情況
# du -sh <目錄名> # 查看指定目錄的大小
# grep MemTotal /proc/meminfo # 查看內(nèi)存總量
# grep MemFree /proc/meminfo # 查看空閑內(nèi)存量
# uptime # 查看系統(tǒng)運(yùn)行時(shí)間、用戶數(shù)、負(fù)載
# cat /proc/loadavg # 查看系統(tǒng)負(fù)載磁盤和分區(qū)
# mount | column -t # 查看掛接的分區(qū)狀態(tài)
# fdisk -l # 查看所有分區(qū)
# swapon -s # 查看所有交換分區(qū)
# hdparm -i /dev/hda # 查看磁盤參數(shù)(僅適用于IDE設(shè)備)
# dmesg | grep IDE # 查看啟動(dòng)時(shí)IDE設(shè)備檢測(cè)狀況網(wǎng)絡(luò)
# ifconfig # 查看所有網(wǎng)絡(luò)接口的屬性
# iptables -L # 查看防火墻設(shè)置
# route -n # 查看路由表
# netstat -lntp # 查看所有監(jiān)聽端口
# netstat -antp # 查看所有已經(jīng)建立的連接
# netstat -s # 查看網(wǎng)絡(luò)統(tǒng)計(jì)信息進(jìn)程
# ps -ef # 查看所有進(jìn)程
# top # 實(shí)時(shí)顯示進(jìn)程狀態(tài)用戶
# w # 查看活動(dòng)用戶
# id <用戶名> # 查看指定用戶信息
# last # 查看用戶登錄日志
# cut -d: -f1 /etc/passwd # 查看系統(tǒng)所有用戶
# cut -d: -f1 /etc/group # 查看系統(tǒng)所有組
# crontab -l # 查看當(dāng)前用戶的計(jì)劃任務(wù)服務(wù)
# chkconfig –list # 列出所有系統(tǒng)服務(wù)
# chkconfig –list | grep on # 列出所有啟動(dòng)的系統(tǒng)服務(wù)程序
# rpm -qa # 查看所有安裝的軟件包
Linux操作系統(tǒng)查看系統(tǒng)信息主要命令
1、查看系統(tǒng)版本:lsb_release -a
2、查看內(nèi)核版本:uname -a
3、查看cpu型號(hào):cat /proc/cpuinfo
4、查看硬盤空間情況:df -h
5、查看內(nèi)存信息:free -m
6、查看網(wǎng)絡(luò)信息:ifconfig
補(bǔ)充:Linux操作系統(tǒng)如何查看系統(tǒng)信息
1:more /etc/issue 命令查看
1.1 Oracle Linux
復(fù)制代碼代碼如下:
[root@DB-Server ~]# more /etc/issueOracle Linux Server release 5.7Kernel \r on an \m
1.2 Centos Linux
復(fù)制代碼代碼如下:
[root@Centos2 ~]# more /etc/issueCentOS release 6.4 (Final)Kernel \r on an \m
1.3 RedHat Linux
復(fù)制代碼代碼如下:
[root@getlnx05 ~]# more /etc/issueRed Hat Enterprise Linux Server release 5.7 (Tikanga)Kernel \r on an \m
2: lsb_release -a 命令查看
2.1 Oracle Linux
復(fù)制代碼代碼如下:
[root@DB-Server ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
Release: 5.7
Codename: Carthage
2.2 Centos Linux
復(fù)制代碼代碼如下:
[root@Centos2 ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.4 (Final)
Release: 6.4
Codename: Final
2.3 RedHat Linux
復(fù)制代碼代碼如下:
[root@getlnx05 ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Release: 5.7
Codename: Tikanga
3:cat /etc/redhat-release 命令查看
這個(gè)命令應(yīng)該只有部分Linux可以查看,不是所有版本Linux都可以使用該命令
3.1 Oracle Linux
復(fù)制代碼代碼如下:
[root@DB-Server ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@DB-Server etc]# cat /etc/*release
Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
Oracle Linux Server release 5.7
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@DB-Server etc]# ls /etc/*lease
/etc/enterprise-release /etc/oracle-release /etc/redhat-release
[root@DB-Server etc]#
3.2 Centos Linux
復(fù)制代碼代碼如下:
[root@Centos2 ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)
[root@Centos2 ~]# cat /etc/*release
CentOS release 6.4 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
CentOS release 6.4 (Final)
CentOS release 6.4 (Final)
[root@Centos2 ~]# ls /etc/*release
/etc/centos-release /etc/lsb-release /etc/redhat-release /etc/system-release
[root@Centos2 ~]#
3.3 RedHat Linux
復(fù)制代碼代碼如下:
[root@getlnx05 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@getlnx05 ~]# cat /etc/*release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@getlnx05 ~]# ls /etc/*release
/etc/redhat-release
[root@getlnx05 ~]#
4 rpm -q redhat-release命令查看,只適用于Redhat Linux
復(fù)制代碼代碼如下:
[root@getlnx05 ~]# rpm -q redhat-release
redhat-release-5Server-5.7.0.3