Raspberry Pi – Guide to obtaining System Information

Shell commands as follows:

System & Hardware Information

CommandDescription
archShow system architecture
cat /boot/cmdline.txtKernel boot parameters
cat /etc/os-releaseOS release information
cat /proc/cpuinfoCPU information
cat /proc/devicesCharacter/block device drivers
cat /proc/device-tree/model && echo “”Raspberry Pi hardware model
cat /proc/filesystemsSupported filesystems
cat /proc/iomemSystem memory map
cat /proc/loadavgLoad average
cat /proc/meminfoMemory information
cat /proc/miscMisc drivers registered
cat /proc/modulesLoaded kernel modules
cat /proc/mountsAll active mounts
cat /proc/partitionsPartition details
cat /proc/statKernel/system stats
cat /proc/uptimeSystem uptime
cat /proc/versionKernel version string
dateShow date/time
hostnamectlHost & OS info (systemd)
idUser identity information
journalctl -bLogs from current boot
lscpuCPU information
lsinitramfs /boot/initrd.img-$(uname -r)Show initramfs contents
lsmemMemory block summary
lsmodShow loaded modules
lshw -shortHardware summary
pstree -pVisual process tree
raspi-gpio getGPIO pin states
sensorsHardware sensor info
systemctl list-unit-files –state=enabledEnabled systemd services
systemctl list-units –failedFailed systemd units
uname -aKernel, architecture, hostname
uptimeHuman readable uptime
vcgencmd get_config intPi integer config values
vcgencmd get_mem arm && vcgencmd get_mem gpuARM/GPU memory split
vcgencmd get_throttledThrottle/voltage warnings
vcgencmd measure_clock armARM core clock
vcgencmd measure_tempCPU temperature
vcgencmd measure_volts coreCore voltage
wLogged-in users and terminals

Processes, Services & Users

CommandDescription
envEnvironment variables
groups <username>Group membership
historyShell history
htopEnhanced process viewer
jobsBackground jobs
lsloginsLast logins
psProcesses info
sudo -lSudo permissions
systemctl list-timersActive systemd timers
systemd-analyze blameSlowest boot services
systemd-analyze critical-chainBoot critical path
wLogged-in users

Packages & Software

CommandDescription
apt-cache policy <package>Package version/source info
apt-cache showPackage metadata
apt list –installedInstalled packages
debsums -cCheck modified package files
dpkg –get-selectionsInstalled package list
dpkg -L <package>Files provided by package
manManual pages

Storage & Filesystems

CommandDescription
blkidFilesystem UUID/type
df /Root filesystem usage
df -hDisk usage summary
df -iInode usage
du -sh /var/*Largest directories
findFind files
lsblkBlock devices
mountCurrent mounts
smartctl -a /dev/sdaSMART disk info
tune2fs -l /dev/mmcblk0p2ext filesystem info

Networking & Connectivity

CommandDescription
dig http://www.google.co.ukDNS lookup
ifconfigIP info
ip addressInterface IP info
ip -s linkInterface statistics
ip route showRouting table
iptables -LFirewall rules
iwconfigWireless config
iwlist wlan0 scanScan wireless networks
iwlist wlan0 scan | grep ESSIDSSID list
mtr 8.8.8.8Traceroute + ping
netstat -lpListening ports
nslookup google.comDNS lookup
ping -c 4 8.8.8.8Connectivity test
resolvectl statusDNS resolver info
rfkill listWireless block status
ss -tulpnSocket list
wpa_cli statusWi-Fi status

Security & Authentication

CommandDescription
fail2ban-client statusFail2Ban status
grep -E “deny|fail” /var/log/auth.logAuthentication failures
ufw status verboseFirewall status

Performance / Monitoring / Benchmarking

CommandDescription
dmesgKernel messages
dmesg –level=err,warnKernel errors & warnings
free -hMemory usage
iostat -xz 1IO performance
stress-ngStress testing
top -bn1One-shot process view
vmstat 1CPU/memory/IO stats
pidstat 2Per-process performance stats

Files, Directories & File Metadata

CommandDescription
catView file contents
echo “$(expr $(</sys/class/thermal/thermal_zone0/temp) / 1000)’CGPU temperature
fileFile type info
grepSearch text
headFirst 10 lines
ls -lDirectory listing
pwdCurrent directory
tailLast 10 lines

Leave a comment