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!
Top comments (0)