Linux diagnostics
System Information¶
-
Display general information about the system:
-
Show system architecture and kernel version:
-
Check OS version and distribution:
Disk and Filesystem Diagnostics¶
-
Check disk usage by filesystem:
-
Check filesystem errors:
-
Display file and directory disk space usage:
-
View disk partitions:
-
Test disk I/O speed:
Memory Diagnostics¶
-
Check free and used memory:
-
Real-time memory usage summary:
-
Analyze memory usage by process:
Install
smemusingsudo apt install smemor your package manager.
CPU Performance¶
-
Monitor real-time processes and CPU usage:
-
Show live CPU usage per core:
Install
htopusingsudo apt install htopor your package manager.- Display CPU frequencies:
Install
cpufrequtilsif not pre-installed.
Network Diagnostics¶
-
Display active network interfaces:
-
Test connectivity (ping a server):
-
Display open ports and listening services:
Use
ss -tulnon modern systems (preferred).- Check network speed:
Install
speedtest-cliusingsudo apt install speedtest-cli.
Logs and Errors¶
-
View system logs:
-
Display kernel messages:
-
Check authentication logs:
Process Diagnostics¶
-
Display active processes (real-time):
-
Kill a hung process (replace
<pid>with the process ID): -
Find and debug a specific process:
Hardware Information¶
-
Check hardware (detailed overview):
-
Check battery status (for laptops):
-
Show PCI devices:
-
List USB devices:
System Load and Uptime¶
-
Check system uptime:
-
Analyze load averages:
-
Read detailed stats of CPU load:
Package Management¶
-
Check installed packages (Debian-based):
-
Search for a package:
-
Update and upgrade packages:
Debugging Kernel Issues¶
-
Debug kernel modules:
-
Remove a kernel module:
Storage Device Health¶
-
SMART disk health check:
Install
smartmontoolsforsmartctlif not installed. -
Test for bad blocks:
Backup and Recovery¶
-
Create disk or partition backup:
-
Compress backup:
Security Diagnostics¶
-
Check open ports for services:
-
Check file permissions and ownership:
-
Detect SUID binaries:
Useful Extras¶
-
Show the last system reboot:
-
Monitor all system services:
-
Check a service's status: