DEV Community

Kanav Gathe
Kanav Gathe

Posted on

Day 2/90: Essential Linux Commands for DevOps 🐧 #90DaysOfDevOps

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Common Use Cases πŸ› οΈ

  1. File Organization
# Create multiple directories
mkdir -p project/{src,docs,tests}

# List contents recursively
ls -R
Enter fullscreen mode Exit fullscreen mode
  1. Project Navigation
# Move to project directory
cd ~/DevOps

# Check current location
pwd

# List all files including hidden
ls -la
Enter fullscreen mode Exit fullscreen mode

Pro Tips 🌟

  1. Use tab completion to save time
  2. Remember your pwd command
  3. Master relative vs absolute paths
  4. Use ls -la to see all file details
  5. Create organized directory structures

Common Mistakes to Avoid ⚠️

  1. ❌ Forgetting where you are (pwd is your friend)
  2. ❌ Not using tab completion
  3. ❌ Ignoring hidden files
  4. ❌ Using absolute paths when relative would be better

Today's Challenge 🎯

Create this directory structure:

DevOps/
β”œβ”€β”€ Git/
β”‚   └── Day-02.txt
β”œβ”€β”€ Linux/
β”‚   β”œβ”€β”€ Commands/
β”‚   └── Scripts/
└── Docker/
Enter fullscreen mode Exit fullscreen mode

Key Takeaways πŸ“

  1. Linux commands are foundational for DevOps
  2. Directory navigation is crucial
  3. Proper organization saves time
  4. 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!

Top comments (0)