Beginner DevOps

Terminal & Command Line

Shell commands, scripting, and automation basics.

Mastering the Terminal

The command line is essential for development, automation, and server management.

Navigation

pwd          # Print working directory
ls -la       # List files (detailed)
cd path      # Change directory
cd ..        # Go up one level
cd ~         # Go to home

File Operations

touch file   # Create file
mkdir dir    # Create directory
cp src dst   # Copy
mv src dst   # Move/rename
rm file      # Remove file
rm -rf dir   # Remove directory

Text Processing

cat file     # View file
head -n 10   # First 10 lines
tail -f log  # Follow log file
grep pattern # Search text
wc -l        # Count lines

Piping & Redirection

cmd1 | cmd2       # Pipe output
cmd > file        # Redirect to file
cmd >> file       # Append to file
cmd 2>&1          # Redirect stderr

Shell Scripting Basics

#!/bin/bash
for file in *.txt; do
  echo "Processing $file"
done