DEV Community

alok-38
alok-38

Posted on

Newbie Bash lessons for DevOps

Bash Beginner guide when starting with DevOps

1️⃣ You logged into a Bash shell

[ec2-user@ip-172-31-64-123 ~]$
Enter fullscreen mode Exit fullscreen mode

It tells you:

  • User: ec2-user

  • Machine: your EC2 instance

  • Location: ~ (your home directory)

  • $ means normal user (safe)

2 Where am I?

pwd
Enter fullscreen mode Exit fullscreen mode

Meaning:

  • Shows your current directory

Example output:

/home/ec2-user
Enter fullscreen mode Exit fullscreen mode

This is your home directory — your safe workspace.

3️⃣ how to see files

Commands:

ls
ls -la
Enter fullscreen mode Exit fullscreen mode
  • ls → lists files

  • -l → detailed view

  • -a → shows hidden files

Files starting with . are hidden config files

4️⃣ Identified important hidden files

In your home directory:

  • .bashrc → runs every time Bash starts

  • .bash_profile → runs when you log in

  • .bash_logout → runs when you log out

  • .ssh/ → SSH keys (very important, don’t touch yet)

5️⃣ reading a config file safely

cat .bashrc
Enter fullscreen mode Exit fullscreen mode

6️⃣ learnt what PATH is

  • A list of directories Bash searches for commands

  • Order matters

  • Your personal directories come first

  • This is why you can type ls instead of /usr/bin/ls

🎯 Where am I now

I can confidently:

  • Understand the shell prompt

  • Navigate the filesystem

  • Read configuration files

  • Explore Linux without breaking anything

This is exactly the right foundation.

Top comments (0)