DEV Community

Kanav Gathe
Kanav Gathe

Posted on β€’ Edited on

1

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!

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

πŸ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay