树莓派的基本查询命令

查询CPU的信息

  • pi@raspberrypi:~ $ lscpu
  • 终端窗口就会打印出CPU的信息:
   Architecture:        armv7l
   Byte Order:          Little Endian
   CPU(s):              4
   On-line CPU(s) list: 0-3
   Thread(s) per core:  1
   Core(s) per socket:  4
   Socket(s):           1
   Vendor ID:           ARM
   Model:               3
   Model name:          Cortex-A72
   Stepping:            r0p3
   CPU max MHz:         1500.0000
   CPU min MHz:         600.0000
   BogoMIPS:            108.00
   Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

可知,这个树莓派使用4核的ARM处理器,最高频率可以达到1500MHz。

查看内存使用情况

  • pi@raspberrypi:~ $ free -h
  • shell打印情况:
                			total        used        free      shared  buff/cache   available
  		      Mem:          3.8Gi       503Mi       2.8Gi       144Mi       538Mi       3.1Gi
             Swap:          99Mi          0B        99Mi

查看SD卡的存储情况

  • pi@raspberrypi:~ $ sudo fdisk -l
  • 最后两行结果:
		Device         Boot  Start      End  Sectors  Size Id Type
   	/dev/mmcblk0p1        8192   532479   524288  256M  c W95 FAT32 (LBA)
   	/dev/mmcblk0p2      532480 60661759 60129280 28.7G 83 Linux
SD卡被分为两个分区,其中一个分区有256MB,专门用于树莓派的开机启动;另一个分区用于储存其他数据。

查找所有的USB外设

  • pi@raspberrypi:~ $ lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 003: ID 25a7:fa61  
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

打印操作系统的信息

  • pi@raspberrypi:~ $ uname -a
		Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

查看网络接口

  • pi@raspberrypi:~ $ ifconfig
eth0: flags=4099  mtu 1500
        ether dc:a6:32:44:3d:69  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163  mtu 1500
        inet 192.168.0.103  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::3757:3d57:76ca:23d3  prefixlen 64  scopeid 0x20
        ether dc:a6:32:44:3d:6a  txqueuelen 1000  (Ethernet)
        RX packets 1002  bytes 722029 (705.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1003  bytes 175535 (171.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

其中,eth0代表以太网接口,wlan0代表WiFi接口,lo是虚拟出来的本地接口用于表示本机。

CPU温度

  • pi@raspberrypi:~ $ vcgencmd measure_temp
  • 返回摄氏温度
    temp=49.0'C

测量树莓派的核心温度

  • pi@raspberrypi:~ $ vcgencmd measure_volts core
  • 返回电压值:
    volt=0.8525V

你可能感兴趣的:(树莓派)