Hello World
Verify the lab workflow: create a file with exact content and permissions.
Concepts
Every lab in this repo works the same way: a container is the practice machine, the tasks say what
the end state should be, and ./lab check inspects the container to see whether I got there. This
lab is the smallest possible example: one file, exact content, exact permissions.
- File content can be written from the shell with redirection (
>overwrites,>>appends). - Unix permissions are three groups (owner, group, others) of read/write/execute bits, often written
in octal:
644means ownerrw-, groupr--, othersr--.
Tasks
Start the lab with ./lab up hello-world, open a shell with ./lab shell hello-world.
- Write the single line
Hello, World!to/root/hello.txt. - Set its permissions to
644.
Check your work from the host: ./lab check hello-world
Hints
echowrites a line; redirect it into the file.chmodchanges permissions; octal mode works.stat -c %a <file>shows the octal mode,cat -A <file>shows hidden characters.
My notes
1. Create and Write Files
touch hello.txt
echo "Hello, World!" > hello.txt
2. Check File Permissions
ls -l hello.txt
stat -c "%a %n" hello.txt
3. Change File Permissions
chmod 644 hello.txt
Remember:
- ls -l → Check permissions.
- chmod → Change permissions.
- > → Overwrite.
- >> → Append.
Related
man chmod,man stat
Checks passed
From my latest pass on 2026-11-01: 3/3
- hello.txt exists
- Content is exactly 'Hello, World!'
- Mode is 644