Linux tools

From BeePerNet
Jump to navigation Jump to search

process

ps -xa --forest
pstree -ca

Disk

  • df

Folders / Files

  • ncdu: Browse folders by size. Find unusual disk usage.

Rescan SCSI Bus

echo "- - -" > /sys/class/scsi_host/hostX/scan

Permissions

find /path/to/base/dir -type d -exec chmod 755 {} +
find /path/to/base/dir -type f -exec chmod 644 {} +

dkms

Rebuild all

ls /usr/src/linux-headers-* -d | sed -e 's/.*linux-headers-//' | sort -V | tac | sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start

Clean up residual configs

apt-get purge $(dpkg -l | grep '^rc' | awk '{print $2}')

find old kernels

dpkg --list | egrep -i --color 'linux-image|linux-headers'