Linux cheatsheet – usefull commands

Network

netstat -tulpn | grep LISTENshow all opened TPC/UDP sockets
sudo ip link set eth0 upenable/disable network interface eth0-interface name up/down
cat /etc/services | lesslist of services and ports
find . -mmin -60 -type f -exec ls -l {} +list changed files in last 60 min
mail -s “Local Outbound SMTP Test” yyyy@xxxx.tld < /dev/nulltest email from terminal
sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -yfull upgrade
curl -T “test.pdf” ftp://192.168.50.5/backup/ -u user:passupload file with CURL to FTP
find mydir -type f -exec curl -u xxx:psw --ftp-create-dirs -T {} ftp://192.168.1.158/public/demon_test/{} \;upload all files with folders/subfolder with CURL to FTP
update-alternatives –config php
update-alternatives –config php-cgi
change system default PHP and PHP-CGI version