Information Collection
Querying OS Information
Query the OS version.
cat /etc/openEuler-latest
[root@localhost ~]# cat /etc/openEuler-latest openeulerversion=openEuler-23.03 compiletime=2023-03-27-12-05-38 gccversion=10.3.1-26.oe2303 kernelversion=6.1.19-7.0.0.17.oe2303 openjdkversion=1.8.0.362.b09-2.oe2303 [root@localhost ~]#
cat /etc/os-release
[root@localhost ~]# cat /etc/os-release NAME="openEuler" VERSION="23.03" ID="openEuler" VERSION_ID="23.03" PRETTY_NAME="openEuler 23.03" ANSI_COLOR="0;31" [root@localhost ~]#
cat /etc/openEuler-release
[root@localhost ~]# cat /etc/openEuler-release openEuler release 23.03 [root@localhost ~]#
Query the kernel version.
uname -a
[root@localhost ~]# uname -a
Linux localhost.localdomain 6.1.19-7.0.0.17.oe2303.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 28 00:01:02 CST 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#
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.)
View all installed software packages.
rpm -qa (systemd is used as an example.)
View the list of software packages.
rpm -ql (python3-rpm is used as an emple.)
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 the logs related to the startup and stop of the daemon process.
cat /var/log/boot.log