← Back to trackModule: Linux Essentials (Week 1)

BEGINNER · Easy · 45m

Navigate the filesystem with confidence

Foundations Bootcamp

Lesson notes

Goal

By the end of this lesson you will be able to move around any Linux server quickly, understand where you are, and find what you need without guessing.

This is not about memorizing commands. It is about building a mental model of paths.

Mental Model (2 minutes)

Think of the filesystem as a tree. Everything is a path.

/
├─ home/
│  └─ rahul/
│     ├─ projects/
│     └─ notes.txt
├─ etc/
├─ var/
└─ tmp/

You always have:

  • a current directory (your location in the tree)
  • a target path (where you want to go)

Core Commands You Must Know

1) Where am I?

pwd

Prints the full absolute path of your current directory.

2) What is here?

ls
ls -lah

Useful flags:

  • -l: long listing (permissions, owner, size, time)
  • -a: include hidden files (starting with .)
  • -h: human sizes (K, M, G)

3) Move to another folder

cd /etc
cd ..
cd ~
cd -

Important shortcuts:

  • . = current directory
  • .. = parent directory
  • ~ = your home directory
  • cd - = jump back to the previous directory

Absolute vs Relative Paths (the most important concept)

Absolute path

Starts from root /.

Example:

cd /var/log

Relative path

Starts from where you currently are.

Example:

cd logs

This only works if a folder named logs exists inside your current directory.

Hidden Files (dotfiles)

Hidden files start with . (like .env, .git, .ssh).

ls -a

Common mistake: people think the file is missing, but it is hidden.

Reading a Directory Listing (like a DevOps engineer)

ls -l

The first character in permissions shows the type:

  • - regular file
  • d directory
  • l symlink (shortcut)

If you see a symlink:

ls -l somefile
readlink -f somefile

Practical Navigation Patterns (what you do in real work)

Jump into logs and back fast

cd /var/log
ls -lah
cd -

Use tab completion (speed)

Start typing and press TAB:

cd /va<TAB>

Create a safe sandbox in /tmp

mkdir -p /tmp/devopslabx-lab
cd /tmp/devopslabx-lab

Finding Things (basic, but extremely useful)

Find by name (fast enough for most tasks)

find . -maxdepth 3 -name "*.log"
find /var/log -type f -name "*.log" 2>/dev/null

Find by content (logs, configs)

grep -R "ERROR" .
grep -R "listen" /etc/nginx 2>/dev/null

Exercises (do these)

Exercise A: Build your navigation muscle

  1. Create folders:
mkdir -p lab/a/b/c
  1. Move into c using a relative path.
  2. Move back to lab using ...
  3. Jump to your home directory.
  4. Jump back using cd -.

Exercise B: Hidden files

  1. Create a hidden file:
touch .secret
  1. Confirm you cannot see it with ls.
  2. Confirm you can see it with ls -a.

Exercise C: Find + grep

  1. Create a file with a few lines containing the word deploy.
  2. Use grep to find those lines.
  3. Use find to locate that file by name.

Troubleshooting Checklist

If cd fails:

  • did you type the path correctly (case matters)
  • are you using relative path but you are in the wrong folder
  • do you have permissions (try ls -ld <dir>)

If a file is missing:

  • is it hidden (ls -a)
  • is it a symlink to somewhere else (ls -l)

Quick Cheat Sheet

pwd                 # where am I?
ls -lah             # what's here (including hidden)
cd /path/to/dir     # go to absolute path
cd ..               # go up one level
cd ~                # home
cd -                # previous directory
find . -name "*.yml"   # search by name
grep -R "text" .       # search by content

Next Step

Once navigation feels easy, you are ready for permissions (chmod, chown) and services (systemctl) because you will always know where configs and logs live.

View full outline

Outline

Use the outline to jump to any topic.

Track tools

Search lessons, continue where you left off, and track completion.

Modules

3

Lessons

9

Estimated Time

515m

Completion

0%

0/9 lessons

Your progress: 0%

Complete a lesson to increase progress

Outline

Open a lesson for full notes. Mark completed to update your progress.

Goal: By the end of this lesson you will be able to move around any Linux server quickly, understand where you are, and find what you need without guessing. This is not about memorizing commands. It is about building a m…

Goal: Understand Linux permissions well enough to fix "permission denied" problems quickly and safely. The Mental Model Every file/folder has: an owner (user) a group permissions for user/group/others Read it as: first c…

Goal: Control services confidently and read logs like an operator. What systemd is (simple) systemd is the service manager on most modern Linux distros. It starts services, restarts them, manages dependencies, and record…

Goal: Use Git the way teams actually work: small commits, feature branches, pull requests, reviews, and safe merges. The Workflow (end to end) Steps: 1. Sync with main 2. Create a branch 3. Commit small changes 4. Push b…

Goal: Recover from Git mistakes without losing work or breaking shared history. The Rule If the commit is already pushed and others might have it: prefer git revert (safe) If it is only local (not pushed): git reset is f…

Goal: Understand common branching strategies and when to use each. Strategy 1: Trunk based (recommended for fast teams) Idea: main stays deployable; branches are short lived. Pattern: small branches frequent merges featu…

Goal: Understand the minimum networking needed to debug real production issues: DNS, ports, HTTP, and TLS. The 4 step model When a request fails, check: 1. DNS: can we resolve the name? 2. Network: can we reach the IP/po…

Goal: Turn messy logs into clear answers using grep/awk/sed and a few patterns you will reuse forever. grep (search) Tips: n : show line number R : recursive E : regex i : case insensitive awk (extract columns) Common us…

Goal: Write a safe, reusable script that checks a service, collects logs, and prints a clean summary. Script building blocks variables functions exit codes strict mode (optional) Example: service health script Make it ex…