Same Place, Three Spellings
EasyLinux Fundamentals12-18 minOne location on a Linux box can be written three different ways, and understanding why is the difference between filing things where you meant to and hunting for them later. This box is set up to make you feel it.
Standing at home (/root), you have four small filing jobs. Each one is really a question about how a path is resolved:
1. ABSOLUTE ADDRESS. There is a report at reports/q1/summary.txt. File it into the system log area at /srv/logs — written the long way, from the leading slash, so it means the same place no matter where you are standing when you run it.
2. THE ~ SHORTHAND. Drop an empty receipt named received.txt into your ~/inbox. The shell expands ~ to your home directory before the command even runs, so ~/inbox is just a shorter way of writing the absolute path to a folder in your home.
3 & 4. THE SAME RELATIVE PATH, TWO PLACES. There are two folders in your home, project/ and backup/, and each contains a data/ directory. Put an empty file named here.txt into the data/ directory of EACH — but reach it the relative way: step into a folder first, then refer to data/here.txt with no leading slash. You will run what looks like the identical command twice and get two files in two different absolute locations, because a relative path is resolved from wherever pwd says you are.
Grading reads the filesystem, not your keystrokes — any spelling that puts the right bytes in the right place passes. But the point of the room is the relative pair: do those two by cd-ing first, and watch the same words land in different places.
- File reports/q1/summary.txt into /srv/logs using its absolute path
- Place received.txt into ~/inbox (let ~ expand to your home)
- From inside project/, create data/here.txt with a relative path
- From inside backup/, create data/here.txt the same relative way
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
