The Ultimate Linux Command Cheat Sheet for Software Developers


As a software developer, especially when managing remote servers or backend systems, Linux commands are essential tools in your daily workflow. Whether you're connecting to servers, transferring code, working with databases, or managing backups, mastering these commands will save you hours of effort.
π 1. SSH (Secure Server Access)
Basic SSH Connection
ssh username@your.server.ip
Using SSH Key
ssh -i ~/.ssh/your-key.pem username@your.server.ip
Keep Long SSH Sessions Alive
# Start a screen session
screen
# Or use tmux
tmux
Detach:
Ctrl+A
thenD
Reattach:
screen -r
ortmux attach
Server-to-Server File Transfer
Using scp
scp file.txt user@remote:/path/
scp -r folder/ user@remote:/path/
scp user@remote:/path/file.txt . # Download from server
Using rsync
(faster for large/multiple files)
rsync -avz /source/ user@remote:/destination/
π 2. Linux File Operations (Move, Copy, Zip)
π Navigating the Filesystem
cd /path/to/directory
ls
ls -alh
pwd
π Move and Copy Files
mv source.txt /destination/
cp source.txt /destination/
cp -r folder/ /destination/
π¦ Zip & Unzip
zip -r archive.zip .
zip -r folder.zip /path/to/folder
zip images.zip *.jpg
zip -r logs.zip *.log
zip -r backup.zip folder1 folder2 file1.txt
unzip archive.zip
unzip archive.zip -d /target/
π
Download Files with curl
curl -O https://example.com/file.zip
curl -o custom.zip https://example.com/file.zip
π File Permissions & Ownership
chmod 755 script.sh
chmod +x deploy.sh
chown user:group file.txt
π Create Symbolic Links
ln -s /actual/path /shortcut/path
π Useful Shortcuts with Aliases
alias devserver='ssh user@192.168.1.2'
alias dbexport='mysqldump -u root -p mydb > ~/backup.sql'
alias reloadshell='source ~/.bashrc'
π File Search & Text Filtering
find . -name "*.log"
grep -rnw '.' -e 'search-term'
grep -i 'error' /var/log/nginx/error.log
awk '{print $1, $3}' filename.txt
cut -d ':' -f1 /etc/passwd
β Directory Cleanup Examples
rm -rf /path/to/folder
rm *.log
rm -f *.tmp
π 3. MySQL: Import, Export, Backup
Export Entire Database
mysqldump -u user -p db_name > backup.sql
Export Specific Table
mysqldump -u user -p db_name table_name > table.sql
Export Multiple Tables
mysqldump -u user -p db_name table1 table2 > partial_backup.sql
Import SQL File
mysql -u user -p db_name < backup.sql
Create Database Before Import
mysql -u user -p -e "CREATE DATABASE new_db;"
mysql -u user -p new_db < backup.sql
β° Automate Backups with cron
crontab -e
Example: Daily backup at 2 AM
0 2 * * * /usr/bin/mysqldump -u user -p'password' db > /home/user/db.sql
π 4. Monitor Server Performance & Logs
π System Health
top # Live processes
htop # (if installed)
df -h # Disk usage
free -m # Memory
uptime # Load average & uptime
vmstat # System performance
π Logs
tail -f /var/log/syslog
tail -f /var/log/nginx/access.log
tail -f /var/log/nginx/error.log
journalctl -u nginx.service
β System Services
systemctl status nginx
systemctl restart nginx
systemctl enable nginx
π’ Network and Ports
netstat -tuln
ss -tuln
lsof -i :80
ping google.com
traceroute google.com
β Final Thoughts
This guide equips you with practical Linux commands for development, deployment, and server maintenance. From connecting via SSH to importing databases and monitoring server health, these tools are indispensable for backend and DevOps workflows.
Let me know if you'd like a downloadable PDF or Markdown version. Happy coding! π»
Subscribe to my newsletter
Read articles from Trushang Suthar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Trushang Suthar
Trushang Suthar
Code is like a puzzleβsometimes you just need to step back, take a breath, and the solution clicks.