Information Collection
Querying OS Information
Query the OS version by running either of the following commands.
cat /etc/openEuler-latest
Output:openeulerversion=openEuler-22.03-LTS-SP2 compiletime=2022-12-27-22-15-04 gccversion=10.3.1-20 kernelversion=5.10.0-136.12.0.86.oe2203sp2 openjdkversion=1.8.0.352.b08-3.oe2203sp2
cat /etc/os-release
Output:NAME="openEuler" VERSION="22.03 (LTS-SP2)" ID="openEuler" VERSION_ID="22.03" PRETTY_NAME="openEuler 22.03 (LTS-SP2)" ANSI_COLOR="0;31"
cat /etc/openEuler-release
Output:openEuler release 22.03 (LTS-SP2)
Query the kernel version.
uname -a
Output:
Linux localhost 5.10.0-136.12.0.86.oe2203sp2.x86_64 #1 SMP Tue Dec 27 17:50:15 CST 2022 x86_64 x86_64 x86_64 GNU/Linux
Querying Hardware Information
Query CPU statistics.
lscpu
View CPU parameters.
cat /proc/cpuinfo
View system memory information.
cat /proc/meminfo
View memory information.
dmidecode -t memory
View hard drive and partition distribution.
lsblk
View details about hard drives and partitions.
fdisk -l
View NIC information.
lspci | grep -i 'eth'
View all network interfaces.
ip a or ifconfig -a
View details about a network interface.
ethtool enp7s0 (enp7s0 is used as an example.)
View PCI information.
lspci
View the device tree.
lspci -t
View BIOS information.
dmidecode -t bios
Querying Software Information
Query details about a software package.
rpm -qi (systemd is used as an example.)
View the modules provided by a software package.
rpm -q --provides # (systemd is used as an example.)
/bin/systemctl /sbin/shutdown config(systemd) = 249-43.oe2203sp2 libsystemd-shared-249.so()(64bit) libsystemd-shared-249.so(SD_SHARED)(64bit) pkgconfig(systemd) = 249 pkgconfig(udev) = 249 syslog system-setup-keyboard = 0.9 systemd = 249-43.oe2203sp2 systemd(x86-64) = 249-43.oe2203sp2 systemd-rpm-config systemd-sysv = 206 systemd-units = 249-43.oe2203sp2
View all installed software packages.
rpm -qa # (systemd is used as an example.)
systemd-help-249-43.oe2203sp2.noarch systemd-libs-249-43.oe2203sp2.x86_64 systemd-249-43.oe2203sp2.x86_64 systemd-udev-249-43.oe2203sp2.x86_64
View the list of software packages.
rpm -ql # (python3-rpm is used as an example.)
Viewing OS Logs
View the information and error logs after the system is started.
cat /var/log/messages
View the security-related logs.
cat /var/log/secure
View the email-related logs.
cat /var/log/maillog
View the logs related to scheduled tasks.
cat /var/log/cron
View the logs related to UUCP and news devices.
cat /var/log/spooler
View system startup logs.
cat /var/log/boot.log