Linux常用命令-系统信息查看命令
在测试自己的Linux板卡系统的时候,尽可能详细的了解Linux系统信息是很重要的。以下是我常用的一些命令,总结出来,分享一下。
本文章秉承对新手友好的原则,简单直白,不做过多复杂描述,如果有帮助,请点个关注鼓励一下,后续会继续分享。
查看系统系统相关信息,显示系统名、节点名称、操作系统的发行版号、操作系统版本、运行系统的机器 ID 号等
uname -a
eg:
jetson@jetson-desktop:/$ uname -a
Linux jetson-desktop 4.9.140-tegra #1 SMP PREEMPT Tue Oct 27 21:02:37 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux
系统版本,在命令行中输入下面的指令:
cat /etc/os-release
eg:
jetson@jetson-desktop:/etc/systemd/system$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
jetson@jetson-desktop:/etc/systemd/system$
查看 CPU 信息
cat /proc/cpuinfo
eg:
jetson@jetson-desktop:/$ cat /proc/cpuinfo
processor : 0
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1
processor : 1
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1
processor : 2
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1
processor : 3
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1
jetson@jetson-desktop:/$
查看CPU型号
cat /proc/cpuinfo | grep "cpu model"
查看内存信息
cat /proc/meminfo
查看CPU温度(temp1_input/temp0_input,需要根据自己环境确认,一般用于Linux开发板)
cat /sys/class/hwmon/hwmon*/temp1_input
查看网卡温度(temp1_input/temp0_input,需要根据自己Linux开发板环境确认,一般用于Linux开发板)
cat /sys/class/net/eth2/device/temp0_input
ethtool 是用于查询及设置网卡参数的命令。查看eth0网卡的驱动信息,内容包括驱动的型号、驱动的版本等。
ethtool -i eth0
free命令可以显示当前系统未使用的和已使用的内存数目,还可以显示被内核使用的内存缓冲区。默认情况下,即在没有选项的情况下,"free"命令显示内存的使用信息。默认按照k(b)的计数单位统计。
sxj@ubuntu:~$ free
total used free shared buff/cache available
Mem: 3969516 1042716 395424 19136 2531376 2618720
Swap: 2097148 2840 2094308
sxj@ubuntu:~$ free -m
total used free shared buff/cache available
Mem: 3876 1022 386 14 2468 2557
Swap: 2047 2 2045
sxj@ubuntu:~$ free -g
total used free shared buff/cache available
Mem: 3 0 0 0 2 2
Swap: 1 0 1
sxj@ubuntu:~$
查看当前文件系统信息,包括容量大小、使用情况、挂载点等
df -h
查看硬盘及分区信息
fdisk -l
设置时间
date -s "2024-1-29 09:25:20"
设置完成后保存设置的时间
hwclock -w
查看开机运行时间,在命令行中输入下面的指令:
uptime
eg:
jetson@jetson-desktop:/etc/systemd/system$ uptime
15:48:17 up 2:00, 2 users, load average: 0.65, 0.69, 0.72
查看其他信息:
dmesg | grep DMA
dmesg | grep eth
dmesg | grep sda
dmesg | grep ttyS*
dmesg | grep -i memory
dmesg | grep -i usb
本文介绍了在Linux系统测试中常用的命令,如查看内核版本、CPU信息、内存使用、温度监控、网卡参数、内存状态、文件系统信息、硬盘分区、时间和硬件日志筛选,适合Linux新手参考。

被折叠的 条评论
为什么被折叠?



