This document lists common bash commands useful for DevOps tasks in production environments.
top/htop— Monitor system processesfree -m— Check memory usagedf -h— Disk space usagedu -sh *— Directory size summaryuptime— System uptimeps aux— List running processesvmstat 1— System performance
ls -l— List files with detailscp source dest— Copy files/directoriesmv source dest— Move/rename files/directoriesrm -rf target— Remove files/directoriesfind /path -name 'pattern'— Search for filescat file— View file contentstail -f logfile— Follow log outputhead file— View start of file
ifconfig/ip a— Show network interfacesping host— Test connectivitynetstat -tulnp— List open portsss -tulwn— Socket statisticscurl url— HTTP requestswget url— Download filesscp user@host:/path .— Secure copyssh user@host— SSH login
apt update && apt upgrade— Update packages (Debian/Ubuntu)yum update— Update packages (RHEL/CentOS)dpkg -l/rpm -qa— List installed packages
whoami— Current userid— User and group infosudo command— Run as superuseradduser username— Add userpasswd username— Change password
systemctl status service— Service statussystemctl restart service— Restart servicejournalctl -u service— Service logs
crontab -l— List cron jobshistory— Command historychmod/chown— Permissions/ownership