For all the tasks, projects that I am doing specially jumping from several programming languages I admit that I cannot remember all those commands when it come to Linux server so I took these notes below as my cheat sheet, I'll keep updating this page whenever I have something to add.
Software
To list the installed software typerpm -qa | less
rpm -qa {software-name}
yum list | less
yum list {software-name}
To remove a software use rpm or yum command as follows
rpm -e {software-name}
yum remove {software-name}
System
reboot command# /sbin/reboot
or
# /sbin/shutdown -r now
Check OS version
cat /proc/version
or
cat /etc/issue
Network
check port used and who is listeningnetstat -tnlp
Rerouting on linux iptables
iptables -A PREROUTING -t nat -p tcp -d 75.xx.xxx.xx --dport 80 -j REDIRECT --to-port 8064
Disable firewall or iptables
# service iptables save
# service iptables stop
# chkconfig iptables off
Files
find file size in folders
du -hs * | sort -rh | head -5
Find Files by extension with size
find vhosts/ -name "*.log" -type f -printf "%s %p\n" | sort -nr | head -10
find vhosts. -name "*.log" -type f
Make file executable:
chmod +x file
Author :
Dario Mindoro
Author of Mindworksoft.com, Full-stack developer, interested in media streaming, automation, photography, AI, and digital electronics