Day 2: Mastering Basic Linux Commands 💻
Hello DevOps enthusiasts! 👋 Welcome to Day 2 of my #90DaysOfDevOps journey. Today, we're diving into the essential Linux commands that every DevOps engineer should know.
Why Linux Commands Matter? 🤔
In DevOps, Linux is everywhere - from development servers to production environments. Understanding basic Linux commands is like learning the alphabet before writing stories!
Essential Commands Breakdown 🔍
Listing Commands (ls
) 📂
ls # List directory contents
ls -l # Long format listing
ls -a # Show hidden files
ls *.sh # List .sh files
ls -i # Show inode numbers
ls -d */ # List directories only
Directory Navigation 🗺️
pwd # Print working directory
cd ~ # Go to home directory
cd - # Go to previous directory
cd .. # Move up one level
cd ../.. # Move up two levels
mkdir dirname # Create directory
Practical Examples 💡
Let's create a basic DevOps project structure:
# Create project structure
mkdir -p DevOps/{Git,Linux/Scripts}
# Navigate and list
cd DevOps
ls -l
# Create a file
touch Linux/Scripts/first_script.sh
Common Use Cases 🛠️
- File Organization
# Create multiple directories
mkdir -p project/{src,docs,tests}
# List contents recursively
ls -R
- Project Navigation
# Move to project directory
cd ~/DevOps
# Check current location
pwd
# List all files including hidden
ls -la
Pro Tips 🌟
- Use tab completion to save time
- Remember your
pwd
command - Master relative vs absolute paths
- Use
ls -la
to see all file details - Create organized directory structures
Common Mistakes to Avoid ⚠️
- ❌ Forgetting where you are (
pwd
is your friend) - ❌ Not using tab completion
- ❌ Ignoring hidden files
- ❌ Using absolute paths when relative would be better
Today's Challenge 🎯
Create this directory structure:
DevOps/
├── Git/
│ └── Day-02.txt
├── Linux/
│ ├── Commands/
│ └── Scripts/
└── Docker/
Key Takeaways 📝
- Linux commands are foundational for DevOps
- Directory navigation is crucial
- Proper organization saves time
- Command options extend functionality
Let's Connect! 🤝
How do you organize your DevOps projects? Share your favorite Linux commands in the comments below!
Linux #DevOps #Technology #Learning #90DaysOfDevOps
This is Day 2 of my #90DaysOfDevOps journey. Follow along as we explore different aspects of DevOps together!