I wrote an article summarizing some commonly used commands before. See ⬇️
This time write a new one to note some intermediate commands.
Check the large file and large folder commands:
find / -type f -size +100M #Find 100Mb+ files in /
find / -type f -size +100M -print0 | xargs -0 du -h | sort -nr #Sort the above search results according to file size
sudo du / -hm --max-depth=2 | sort -nr | head -20 #Find top 20 large folder in /
du -s /* | sort -nr #Sort folders in / by size
Install and uninstall deb packages
We often encounter programs that are manually installed using deb packages, which cannot be maintained or uninstalled in the software center(Ubuntu desktop).
sudo dpkg -i package_file.deb #install deb package
sudo dpkg -r package_name #uninstall deb package
dpkg -l *xxx* #Find xxx package, wildcard * is acceptable