🐧 Linux Index

Essential Linux commands and system administration skills for working with AWS EC2 instances and DevOps workflows.

Overview

Linux is the foundation of most cloud infrastructure. Understanding Linux commands and system administration is crucial for managing AWS resources, troubleshooting issues, and automating workflows.

Core Concepts

Networking

  • 1 IP Commands - Modern IP networking commands (ip addr, ip route, ip link)

Storage Management

User Management and Permissions

Data Processing

Learning Path

Follow this sequence for optimal understanding:

  1. Networking: 1 IP Commands - Essential networking commands
  2. Storage: 2 Volume Mounting - Manage file systems
  3. Permissions: 3 sudo Command - Understand privilege escalation
  4. Data: 4 jq JSON Processor - Process JSON data

Key Concepts

Essential Linux Skills

Networking

  • Configure network interfaces
  • View routing tables
  • Troubleshoot connectivity
  • Monitor network traffic

Storage

  • Mount EBS volumes
  • Configure file systems
  • Manage disk space
  • Set up persistent mounts

Permissions

  • User and group management
  • File permissions (chmod, chown)
  • Sudo configuration
  • Security best practices

Data Processing

  • Parse JSON from AWS CLI
  • Filter and transform data
  • Automate data workflows
  • Debug API responses

Common Linux Commands

File Operations

ls -la          # List files with details
cd /path        # Change directory
pwd             # Print working directory
cp source dest  # Copy files
mv source dest  # Move/rename files
rm file         # Remove files
mkdir dir       # Create directory

File Viewing

cat file        # Display file contents
less file       # Page through file
head -n 10 file # First 10 lines
tail -n 10 file # Last 10 lines
tail -f file    # Follow file updates

File Editing

nano file       # Simple text editor
vim file        # Advanced text editor

Process Management

ps aux          # List all processes
top             # Interactive process viewer
htop            # Enhanced process viewer
kill PID        # Terminate process
killall name    # Kill by process name

System Information

uname -a        # System information
df -h           # Disk space usage
free -h         # Memory usage
uptime          # System uptime

Package Management

Ubuntu/Debian (apt)

sudo apt update
sudo apt upgrade
sudo apt install package
sudo apt remove package

Amazon Linux/RHEL (yum)

sudo yum update
sudo yum install package
sudo yum remove package

User Management

whoami          # Current user
id              # User ID and groups
sudo su -       # Switch to root
useradd user    # Create user
passwd user     # Set password

AWS-Specific Linux Usage

EC2 Instance Management

  • SSH into instances
  • Configure instance networking
  • Mount EBS volumes
  • Install and configure software
  • Set up monitoring agents

Automation

  • User data scripts for instance initialization
  • Cron jobs for scheduled tasks
  • Shell scripts for common operations
  • AWS CLI for resource management

Troubleshooting

  • Check system logs (/var/log/)
  • Monitor resource usage
  • Debug application issues
  • Network connectivity testing

Best Practices

Security

  • Use SSH keys, not passwords
  • Disable root login
  • Keep system updated
  • Use sudo instead of root
  • Configure firewall (iptables/ufw)
  • Regular security audits

System Administration

  • Regular backups
  • Monitor disk space
  • Rotate logs
  • Document configurations
  • Use configuration management tools

Performance

  • Monitor system resources
  • Optimize running services
  • Clean up unnecessary files
  • Use appropriate instance types

Prerequisites

AWS Integration

  • EC2 - Linux instances on AWS
  • EFS - Storage for Linux instances
  • User Data - Automate Linux setup

DevOps Tools

Advanced Topics

Common Use Cases

  1. EC2 Instance Setup - Initial configuration and software installation
  2. Log Analysis - Troubleshoot application and system issues
  3. Automation Scripts - Automate repetitive tasks
  4. Performance Monitoring - Track system health and resource usage
  5. Security Hardening - Secure Linux instances
  6. Data Processing - Parse and transform data with command-line tools

Learning Resources

Online Resources

  • Linux Journey - Interactive learning
  • The Linux Command Line (book)
  • AWS Linux Academy
  • Ubuntu/RHEL documentation

Practice

  • Launch EC2 instances for hands-on practice
  • Use Linux locally (WSL, VM, or native)
  • Complete AWS labs and tutorials
  • Build automation scripts

Certifications

  • Linux Professional Institute (LPIC)
  • Red Hat Certified System Administrator (RHCSA)
  • AWS Certified SysOps Administrator

Troubleshooting

Common Issues

  • Permission denied - Check file permissions and use sudo
  • Command not found - Install package or check PATH
  • Disk full - Clean up logs and temporary files
  • Cannot connect via SSH - Check security groups and key permissions
  • Service won’t start - Check logs in /var/log/

Back to Main Index

← Back to AWS Notes Index