useful bash commands
List applications listening on ports
netstat -lnpList running processes
ps auxList running processes and search for a particular process name
ps aux | grep <process name>Search for text within a set of files
grep "text string" *.*Search for text within a set of files, case insensitive
grep -i "text string" *.*Search for text within a set of files and display X lines before and after match
grep -C 2 "text string" *.*Check the current directory
pwdGet BIOS system information
sudo dmidecodeOn Debian distros, you can use apt-get to find available package versions using:
apt-cache madison <package name>To install a specific version of a package, use the above command to get version info then:
sudo apt install <package name>=<version>And finally using apt-mark, you can hold onto a specific package version:
sudo apt-mark hold <package name>To remove old kernel packages from the boot partion on Ubuntu you can use the following command:
sudo apt remove --purge $(dpkg -l 'linux-image-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')