0
Programming Foundations
Phase 0Module 4 of 14

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

100%
Loading diagram...

Scroll inside the frame · use + / − to zoom

100%
Loading diagram...

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 files
  • cd /path && pwd # navigate to a folder and show current path
  • tail -f app.log # follow live log output in real time
  • ps aux | grep name # find a running process by name
  • chmod 600 .env # restrict file access to owner only
  • df -h # check available disk space
  • grep -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