🐧 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
- 2 Volume Mounting - Mount and unmount file systems and volumes
User Management and Permissions
- 3 sudo Command - Execute commands with elevated privileges
Data Processing
- 4 jq JSON Processor - Parse and manipulate JSON data from command line
Learning Path
Follow this sequence for optimal understanding:
- Networking: 1 IP Commands - Essential networking commands
- Storage: 2 Volume Mounting - Manage file systems
- Permissions: 3 sudo Command - Understand privilege escalation
- 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 directoryFile 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 updatesFile Editing
nano file # Simple text editor
vim file # Advanced text editorProcess Management
ps aux # List all processes
top # Interactive process viewer
htop # Enhanced process viewer
kill PID # Terminate process
killall name # Kill by process nameSystem Information
uname -a # System information
df -h # Disk space usage
free -h # Memory usage
uptime # System uptimePackage Management
Ubuntu/Debian (apt)
sudo apt update
sudo apt upgrade
sudo apt install package
sudo apt remove packageAmazon Linux/RHEL (yum)
sudo yum update
sudo yum install package
sudo yum remove packageUser Management
whoami # Current user
id # User ID and groups
sudo su - # Switch to root
useradd user # Create user
passwd user # Set passwordAWS-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
Related Topics
Prerequisites
- Internet Fundamentals - Networking basics
- UDP - Network protocols
AWS Integration
DevOps Tools
- Docker - Containerization on Linux
- Terraform - Infrastructure as Code
- CloudFormation - AWS IaC
Advanced Topics
- ECS - Container orchestration
- Kubernetes - K8s on Linux
Common Use Cases
- EC2 Instance Setup - Initial configuration and software installation
- Log Analysis - Troubleshoot application and system issues
- Automation Scripts - Automate repetitive tasks
- Performance Monitoring - Track system health and resource usage
- Security Hardening - Secure Linux instances
- 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/