teluzia.Cloud Engineer · Day 2
CHAPTER 01 · LINUX FUNDAMENTALS AND GIT

Navigation and file management

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Navigation becomes easier when you treat each command as a precise filesystem operation. Today you create a small notes tree, inspect it, copy one file, move another and remove only files you deliberately created. You will compare the current working directory with the path passed to a command. These habits matter because the same command can succeed in one directory and fail in another. By the end, you should explain the difference between a copy and a move, predict a command's destination, and use inspection before a destructive operation rather than relying on memory.

Think of it this way

Copying is photocopying a document; moving is relocating the original to another shelf.

TOPIC 01 / 03Step by step

Navigation and inspection

pwd answers where you are, cd changes that location, and ls lists directory entries. They serve different purposes: listing a directory does not move you into it. ls -l includes metadata, and ls -a includes names beginning with a dot. A relative filename is interpreted from the current working directory, whereas an absolute filename begins at /. Use cd -- "$HOME/teluzia/day02" when a directory is already created, then verify with pwd. Navigation should be deliberate because many later tools read configuration or create output relative to the current directory.

WORKED EXAMPLE
pwd; ls -la; cd ..; pwd
Why this matters

Knowing the current directory prevents misplaced outputs and lets you reproduce a failed command using the same path assumptions each time accurately.

A common trap

Reading an ls listing as proof that you changed directories is incorrect; only cd changes your shell’s working directory for later commands.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Navigation and inspection

pwd answers where you are, cd changes that location, and ls lists directory entries. They serve different purposes: listing a directory does not move you into it. ls -l includes metadata, and ls -a includes names beginning with a dot. A relative filename is interpreted from the current working directory, whereas an absolute filename begins at /. Use cd -- "$HOME/teluzia/day02" when a directory is already created, then verify with pwd. Navigation should be deliberate because many later tools read configuration or create output relative to the current directory.

WORKED EXAMPLE
pwd; ls -la; cd ..; pwd

Why this matters

Knowing the current directory prevents misplaced outputs and lets you reproduce a failed command using the same path assumptions each time accurately.

A common trap

Reading an ls listing as proof that you changed directories is incorrect; only cd changes your shell’s working directory for later commands.

Copy, move and directory creation

mkdir creates a directory; mkdir -p also creates missing parents and tolerates existing directories. cp creates another copy of data, while mv changes a name or location. A destination that already exists as a directory behaves differently from a destination filename. For example, cp note.txt archive/ places a copy inside archive, while cp note.txt backup.txt creates a file named backup.txt. Use cp -i or mv -i for an interactive overwrite check during beginner practice. Always inspect source and destination before deciding whether an existing file should be replaced.

WORKED EXAMPLE
mkdir -p archive; cp -i note.txt archive/; mv -i note.txt draft.txt

Why this matters

Understanding destination rules protects existing work and makes file organization predictable when you later build scripts that manipulate many files automatically safely.

A common trap

Moving a source before verifying its destination can replace another file; interactive flags help, but careful source and destination inspection remains essential.

Removal and safe scope

rm removes directory entries and generally has no built-in recycle bin. rmdir removes only an empty directory, which makes it useful for conservative cleanup. Globs such as *.txt are expanded by the shell before a command runs; inspect their matches with printf before using them for removal. The -- marker ends option parsing for tools that support it, so a filename beginning with a hyphen is treated as data. For this course, cleanup targets should be explicit lab files inside a verified directory. Recursive deletion is unnecessary for today's small exercise.

WORKED EXAMPLE
printf "%s\n" *.txt; rm -i -- backup.txt; rmdir empty

Why this matters

Narrow cleanup scope prevents irreversible loss and creates a habit of verifying targets before introducing recursive automation or administrator privileges into workflows.

A common trap

Running rm from an assumed directory or using a broad wildcard can remove unrelated work; print targets and verify pwd before deleting.

KEEP THESE WITH YOU

Today’s takeaways

Inspect before changing paths.

Copy preserves the source; move relocates it.

Remove explicit lab files only.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed