Skip to content

Linux

Disk and Files

Find disk usage for the current working directory
sudo du --max-depth=1 --block-size=MB ./* | sort -n
find -type f -links +1

APT

Fix APT when stuck on User prompt from automated process:
sudo fuser -vki -TERM /var/lib/dpkg/lock var/lib/dpkg/lock-frontend
sudo dpkg --configure -a
Another option:
sudo fuser --vki /var/cache/debconf/config.dat
Fix broken packages
sudo apt install -y --fix-broken
Run a shell script remotely without transferring to disk
ssh -o ConnectTimeout=10 -T node1 "VAR1=${VAR1} bash -s" < ./script.sh