Linux
Your AI app runs on a Linux server in production. You need the terminal to fix crashes, read logs, and restart services.
Linux is the backstage of a theater — users see the app on stage, engineers work behind the scenes.
Visual Workflows
Start here — study each diagram, then use + / − to zoom if needed.
Overview
Scroll inside the frame · use + / − to zoom
Scroll inside the frame · use + / − to zoom
Key Takeaways
- 1.Linux is the operating system behind most cloud servers and containers — you use its terminal to deploy, debug, and manage AI apps.
- 2.Key skills: navigate files (cd, ls), read logs (tail, grep), manage processes (ps, kill), and set permissions (chmod).
Real Example
Scenario
Your RAG API crashes in production and users see a 500 error.
What you would do
SSH into the server, run docker logs to find the ERROR, check disk space with df -h, and restart the service.
Practice Task
In your terminal: run pwd, ls, and cd into a project folder. Create a test.log file with a few lines, then grep a word in it. Run ps to list running processes.
Commands
Commands to Remember
ls -la # list files with permissions and hidden filescd /path && pwd # navigate to a folder and show current pathtail -f app.log # follow live log output in real timeps aux | grep name # find a running process by namechmod 600 .env # restrict file access to owner onlydf -h # check available disk spacegrep -r "pattern" dir/ # search for text inside files
Cheat Sheet
Quick recap
quick ref- •Most cloud servers run Linux — access via SSH
- •Navigate: ls, cd, pwd · Read logs: tail -f, grep
- •Manage processes: ps, kill, systemctl
- •chmod 600 .env — protect API keys on server
- •df -h — check disk space (common crash cause)
- •Never run production services as root
Common Mistakes
- ✕Running everything as root
- ✕Not checking disk space before large indexing jobs
- ✕Leaving API keys in shell history