You can use a safe interactive log cleanup script that: Scans /var/log for the largest files. Shows their sizes. Asks for confirmation before clearing each file. Clears only files you approve. Keeps the log files in place, so services can continue writing to them. Script: cleanup_logs.sh ################################################### #!/bin/bash LOG_DIR="/var/log" MIN_SIZE="+100M" if [[ $EUID -ne 0 ]]; then echo "Please run this script as root." exit 1 fi echo "========== Disk Usage Before ==========" df -h "$LOG_DIR" du -sh "$LOG_DIR" echo echo "Scanning log files larger than 100 MB..." echo find "$LOG_DIR" -type f -size "$MIN_SIZE" -print0 | while IFS= read -r -d '' file; do # Skip symlinks [[ -L "$file" ]] && continue size=$(du -h "$file" | cut -f1) echo "--------------------------------------" echo "File : $f...
LINUX SYSTEM INFORMATION REPORT nano system_info.sh save ctrl+x chmod +x system_info.sh ./system_info.sh #!/bin/bash echo "========================================" echo " SYSTEM INFORMATION REPORT" echo "========================================" # Hostname & OS echo "Hostname : $( hostname )" echo "OS : $( cat /etc/os-release | grep PRETTY_NAME | cut -d= -f2 | tr -d '\"')" echo "Kernel : $( uname -r )" echo "----------------------------------------" # CPU Info echo "CPU Model : $( lscpu | grep 'Model name' | sed 's/Model name:[ \t]*//')" echo "CPU Cores : $( nproc )" echo "----------------------------------------" # Memory Info free -h | awk ' /Mem:/ { print "RAM Total : " $2 print "RAM Used : " $3 ...