5 minutes
A short round: up to five due cards or questions, then one terminal task.
Loading what is due.
Terminal task
Mission
You just logged in to web-01. Find out which folder you are in.
Task 1/1: You just logged in to web-01. Find out which folder you are in.
Mission
You just logged in to web-01. Find out which folder you are in.
Task complete
Solution
pwd Why: After a login you usually land in your home folder, but on a strange server you check. Every relative path depends on the answer.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Mission
Somebody left a hidden file in your home folder. Find it and read what it says.
Task 1/1: Somebody left a hidden file in your home folder. Find it and read what it says.
Mission
Somebody left a hidden file in your home folder. Find it and read what it says.
Task complete
Solution
ls -a
cat .secret Why: The dot is not a protection, only a convention. Anybody who may read the file can read it, ls just keeps the list short. Listing alone tells you the name, not what is inside.
Loading terminal …
Not done yet
Terminal task
Change to /var/log/app and list the files so that the most recently changed one is on top.
Task 1/1: Change to /var/log/app and list the files so that the most recently changed one is on top.
Change to /var/log/app and list the files so that the most recently changed one is on top.
Task complete
Solution
cd /var/log/app
ls -t Why: On a server the newest file is the one somebody or something wrote to last. That is usually where the story of the last few minutes is.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Mission
Print exactly the last 3 lines of logs/app.log.
Task 1/1: Print exactly the last 3 lines of logs/app.log.
Mission
Print exactly the last 3 lines of logs/app.log.
Task complete
Solution
tail -n 3 logs/app.log Why: The last lines tell you what happened most recently. tail works on any file without counting. sed and awk, which come later in this path, can print the same lines, but only if you tell them where they are.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
A service just restarted and you want to see how the log starts. Print the first 2 lines of logs/app.log.
Task 1/1: A service just restarted and you want to see how the log starts. Print the first 2 lines of logs/app.log.
A service just restarted and you want to see how the log starts. Print the first 2 lines of logs/app.log.
Task complete
Solution
head -n 2 logs/app.log Why: The start of a log often shows the version and settings a service came up with. That is where a wrong config shows first.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Print the name of this machine with hostname, then show your history so that the line appears in it.
Task 1/1: Print the name of this machine with hostname, then show your history so that the line appears in it.
Print the name of this machine with hostname, then show your history so that the line appears in it.
Task complete
Solution
hostname
history Why: From now on you can reach that line with the up arrow, with Ctrl-R or with its number. You only ever type it once.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Find out with type whether cd is a program in /usr/bin or built into the shell.
Task 1/1: Find out with type whether cd is a program in /usr/bin or built into the shell.
Find out with type whether cd is a program in /usr/bin or built into the shell.
Task complete
Solution
type cd Why: cd has to be built in. A separate program could only change its own folder, not the one of your shell. So cd has no manual page of its own; help cd explains it.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Mission
Create a folder called backup in your home folder and copy your notes (notes.txt) into it. The original stays where it is.
Task 1/1: Create a folder called backup in your home folder and copy your notes (notes.txt) into it. The original stays where it is.
Mission
Create a folder called backup in your home folder and copy your notes (notes.txt) into it. The original stays where it is.
Task complete
Solution
mkdir backup
cp notes.txt backup/ Why: The slash at the end says that backup is meant as a folder. If the folder were missing, cp would refuse instead of quietly creating a file called backup.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
You are about to change projects/shop/app.conf. First make a copy next to it, called app.conf.bak, that keeps the original time.
Task 1/1: You are about to change projects/shop/app.conf. First make a copy next to it, called app.conf.bak, that keeps the original time.
You are about to change projects/shop/app.conf. First make a copy next to it, called app.conf.bak, that keeps the original time.
Task complete
Solution
cp -p projects/shop/app.conf projects/shop/app.conf.bak Why: If the change goes wrong, one cp the other way round brings back the old state in seconds.
Another way
cp projects/shop/app.conf projects/shop/app.conf.bak Without -p the content is the same, but the copy gets the current time. Later you can no longer tell from ls -l when the config last changed.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Copy the whole folder projects/shop to shop.bak in your home folder.
Task 1/1: Copy the whole folder projects/shop to shop.bak in your home folder.
Copy the whole folder projects/shop to shop.bak in your home folder.
Task complete
Solution
cp -r projects/shop shop.bak Why: -r takes everything below the folder along. mv would have worked too, but then the original would be gone, and that is no backup.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Rename projects/shop/README.md to projects/shop/ABOUT.md.
Task 1/1: Rename projects/shop/README.md to projects/shop/ABOUT.md.
Rename projects/shop/README.md to projects/shop/ABOUT.md.
Task complete
Solution
mv projects/shop/README.md projects/shop/ABOUT.md Why: mv changes only the entry in the folder. The content, its time and its owner stay as they are.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Delete all .log files in projects/shop with one pattern. Check first with ls what the pattern hits. Everything else stays.
Task 1/1: Delete all .log files in projects/shop with one pattern. Check first with ls what the pattern hits. Everything else stays.
Delete all .log files in projects/shop with one pattern. Check first with ls what the pattern hits. Everything else stays.
Task complete
Solution
ls projects/shop/*.log
rm projects/shop/*.log Why: The shell expands the pattern before ls or rm even start, so both get the same list. If ls shows the right files, rm deletes the right files.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Create a symbolic link called current in your home folder that points to projects/shop/releases/v2.4.1.
Task 1/1: Create a symbolic link called current in your home folder that points to projects/shop/releases/v2.4.1.
Create a symbolic link called current in your home folder that points to projects/shop/releases/v2.4.1.
Task complete
Solution
ln -s projects/shop/releases/v2.4.1 current Why: A rollback is now only a new link to v2.4.0. Nothing gets copied, and the service always finds its files under the same name.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Give notes.txt a second name second.txt with a hard link, then show the link count and name of both with stat -c '%h %n'.
Task 1/1: Give notes.txt a second name second.txt with a hard link, then show the link count and name of both with stat -c '%h %n'.
Give notes.txt a second name second.txt with a hard link, then show the link count and name of both with stat -c '%h %n'.
Task complete
Solution
ln notes.txt second.txt
stat -c '%h %n' notes.txt second.txt Why: The count went from 1 to 2. Delete notes.txt now and it drops back to 1, and the text is still there under second.txt. The space is only free when the count reaches 0.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Find out how much space each entry in your home folder takes up, one total each.
Task 1/1: Find out how much space each entry in your home folder takes up, one total each.
Find out how much space each entry in your home folder takes up, one total each.
Task complete
Solution
du -sh * Why: The biggest one stands out at once: the archive, not the logs. Note that * leaves out names with a leading dot, so hidden folders do not show up here.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Under projects, find all .log files that were last changed more than 30 days ago.
Task 1/1: Under projects, find all .log files that were last changed more than 30 days ago.
Under projects, find all .log files that were last changed more than 30 days ago.
Task complete
Solution
find projects -name "*.log" -mtime +30 Why: This line is how you find clean-up candidates. test.log is left out, because it was changed yesterday.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Find all files larger than 40 MiB below your home folder.
Task 1/1: Find all files larger than 40 MiB below your home folder.
Find all files larger than 40 MiB below your home folder.
Task complete
Solution
find . -size +40M Why: When a disk fills up, a few big files are usually to blame. A search by size finds them, no matter how deep they are.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Delete build.log under projects with find and -exec. First run the same line without -exec. test.log stays.
Task 1/1: Delete build.log under projects with find and -exec. First run the same line without -exec. test.log stays.
Delete build.log under projects with find and -exec. First run the same line without -exec. test.log stays.
Task complete
Solution
find projects -name "build.log"
find projects -name "build.log" -exec rm {} \; Why: Between the two lines only the action differs. So what you saw is exactly what gets deleted. This habit pays off most on a tree you do not know.
Another way
find projects -name "build.log"
find projects -name "build.log" -delete -delete is shorter and needs no rm, but it is only safe at the very end of the line. -exec rm can be swapped for -exec ls -l to take another look.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Mission
How many ERROR lines are there in logs/app.log? Only the number should end up on the screen.
Task 1/1: How many ERROR lines are there in logs/app.log? Only the number should end up on the screen.
Mission
How many ERROR lines are there in logs/app.log? Only the number should end up on the screen.
Task complete
Solution
grep -c ERROR logs/app.log Why: You could read the 17 lines here by eye, but on a real server it is a few hundred thousand. grep -c ERROR counts matching lines, not matches: two errors in one line count once. For most logs that is exactly what you want.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
The INFO noise hides what matters. Print all lines of logs/app.log that do not contain INFO, with their line numbers.
Task 1/1: The INFO noise hides what matters. Print all lines of logs/app.log that do not contain INFO, with their line numbers.
The INFO noise hides what matters. Print all lines of logs/app.log that do not contain INFO, with their line numbers.
Task complete
Solution
grep -vn INFO logs/app.log Why: -v is the quick way to get rid of noise. With the line numbers you find the spot again in less, by typing the number followed by g.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Yesterday somebody changed conf/app.conf. Compare the backup conf/app.conf.bak with it, in the format that git uses as well.
Task 1/1: Yesterday somebody changed conf/app.conf. Compare the backup conf/app.conf.bak with it, in the format that git uses as well.
Yesterday somebody changed conf/app.conf. Compare the backup conf/app.conf.bak with it, in the format that git uses as well.
Task complete
Solution
diff -u conf/app.conf.bak conf/app.conf Why: Now you know that two values changed, workers and log_level. Exit code 1 is not an error here. It means the files differ, and scripts can ask exactly that.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Who visits most often? Count the lines of visitors.txt per address, with the biggest count on top.
Task 1/1: Who visits most often? Count the lines of visitors.txt per address, with the biggest count on top.
Who visits most often? Count the lines of visitors.txt per address, with the biggest count on top.
Task complete
Solution
sort visitors.txt | uniq -c | sort -rn Why: The first sort groups equal lines, uniq -c counts each group, and the second sort orders by that count. -n because the counts are numbers, -r to get the biggest first.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
sizes.txt lists folders with their sizes. Print only the line with the biggest size.
Task 1/1: sizes.txt lists folders with their sizes. Print only the line with the biggest size.
sizes.txt lists folders with their sizes. Print only the line with the biggest size.
Task complete
Solution
sort -rh sizes.txt | head -n 1 Why: With -n, 95M would beat 2.1G, because 95 is bigger than 2. -h reads the unit too. It is the same pair as du -sh * | sort -rh on a real server.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Save orders.csv sorted by amount (third column, as a number) in the file sorted.csv.
Task 1/1: Save orders.csv sorted by amount (third column, as a number) in the file sorted.csv.
Save orders.csv sorted by amount (third column, as a number) in the file sorted.csv.
Task complete
Solution
sort -t, -k3 -n -o sorted.csv orders.csv Why: Here, -o and > come to the same thing. They only differ when the output is also the input, and that is the one case where -o saves you.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show env.conf with every staging replaced by production, also where it comes twice in a line. Do not change the file.
Task 1/1: Show env.conf with every staging replaced by production, also where it comes twice in a line. Do not change the file.
Show env.conf with every staging replaced by production, also where it comes twice in a line. Do not change the file.
Task complete
Solution
sed 's/staging/production/g' env.conf Why: The first pass without -i is your preview. The file stays untouched, so you can look at the result as long as you want.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Print only the lines of logs/app.log that contain WARN, with sed and not with grep.
Task 1/1: Print only the lines of logs/app.log that contain WARN, with sed and not with grep.
Print only the lines of logs/app.log that contain WARN, with sed and not with grep.
Task complete
Solution
sed -n '/WARN/p' logs/app.log Why: For this alone, grep is shorter. The address form becomes useful once you want to change only certain lines, as in sed '/WARN/s/a/b/'.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Now for real. Change DEBUG=true to DEBUG=false in env.conf, and keep the old state as env.conf.bak.
Task 1/1: Now for real. Change DEBUG=true to DEBUG=false in env.conf, and keep the old state as env.conf.bak.
Now for real. Change DEBUG=true to DEBUG=false in env.conf, and keep the old state as env.conf.bak.
Task complete
Solution
sed -i.bak 's/DEBUG=true/DEBUG=false/' env.conf Why: There is no space between -i and .bak. With a space, GNU sed takes .bak as the script and the rest goes wrong.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
The second column of logs/app.log is the level. Print only that column for every line.
Task 1/1: The second column of logs/app.log is the level. Print only that column for every line.
The second column of logs/app.log is the level. Print only that column for every line.
Task complete
Solution
awk '{print $2}' logs/app.log Why: In this log, there are two spaces behind INFO but only one behind ERROR. awk does not care, and cut would stumble over exactly that.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Print the customers from orders.csv whose amount (third column) is greater than 100. Only the names, separated by a comma in the file.
Task 1/1: Print the customers from orders.csv whose amount (third column) is greater than 100. Only the names, separated by a comma in the file.
Print the customers from orders.csv whose amount (third column) is greater than 100. Only the names, separated by a comma in the file.
Task complete
Solution
awk -F, 'NR>1 && $3 > 100 {print $1}' orders.csv Why: Without NR>1, the header slips through. amount is no number, so awk compares it as text, and as text it is greater than 100. That is a typical quiet error with CSV files.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
What do all orders in orders.csv add up to? Only the number should be on the screen.
Task 1/1: What do all orders in orders.csv add up to? Only the number should be on the screen.
What do all orders in orders.csv add up to? Only the number should be on the screen.
Task complete
Solution
awk -F, 'NR>1 {sum += $3} END {print sum}' orders.csv Why: The variable starts at 0 and needs no declaration. The header counts as 0 when you add it, so the result is the same here, but the NR>1 says what you mean.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Save the ERROR lines of logs/app.log in the file errors.txt in your home folder.
Task 1/1: Save the ERROR lines of logs/app.log in the file errors.txt in your home folder.
Save the ERROR lines of logs/app.log in the file errors.txt in your home folder.
Task complete
Solution
grep ERROR logs/app.log > errors.txt Why: The check looks at the file and not at what you typed. If the file has exactly these lines, it does not matter how they got there.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Add the WARN lines of logs/app.log to the end of notes.txt. What was in notes.txt must stay.
Task 1/1: Add the WARN lines of logs/app.log to the end of notes.txt. What was in notes.txt must stay.
Add the WARN lines of logs/app.log to the end of notes.txt. What was in notes.txt must stay.
Task complete
Solution
grep WARN logs/app.log >> notes.txt Why: One character decides between "add to it" and "throw it away". That is why noclobber exists, and why it is worth a second look before you press Enter.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Run ls logs nope and collect both the list and the error message in the file all.txt. Nothing should remain on the screen.
Task 1/1: Run ls logs nope and collect both the list and the error message in the file all.txt. Nothing should remain on the screen.
Run ls logs nope and collect both the list and the error message in the file all.txt. Nothing should remain on the screen.
Task complete
Solution
ls logs nope > all.txt 2>&1 Why: &> is the short form in bash, but a plain sh does not know it. In scripts for other shells, > file 2>&1 is the safe form.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show the content of the folder cache and save the same list in inventory.txt, in one line.
Task 1/1: Show the content of the folder cache and save the same list in inventory.txt, in one line.
Show the content of the folder cache and save the same list in inventory.txt, in one line.
Task complete
Solution
ls cache | tee inventory.txt Why: With ls > file you would see nothing, with ls and then ls > file you would run it twice. tee gives you both from one run.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Add the line "checked" to the end of notes.txt with tee, and see it on the screen as well. What was in the file must stay.
Task 1/1: Add the line "checked" to the end of notes.txt with tee, and see it on the screen as well. What was in the file must stay.
Add the line "checked" to the end of notes.txt with tee, and see it on the screen as well. What was in the file must stay.
Task complete
Solution
echo checked | tee -a notes.txt Why: This is the tee form you will see most often on real servers, with sudo in front of tee, to add a line to a config that belongs to root.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Delete all .tmp files in the folder cache, including the one with a space in its name, with find and xargs. keep.log stays.
Task 1/1: Delete all .tmp files in the folder cache, including the one with a space in its name, with find and xargs. keep.log stays.
Delete all .tmp files in the folder cache, including the one with a space in its name, with find and xargs. keep.log stays.
Task complete
Solution
find cache -name "*.tmp" -print0 | xargs -0 rm Why: A zero byte is the one character that cannot occur in a file name, so it separates reliably. The check looks at the folder afterwards and not at the words you typed.
Another way
find cache -name "*.tmp" -delete Shorter, and without the pipe there is nothing to split. It only works for deleting, while -print0 | xargs -0 works with every command.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Make deploy.sh executable for everyone. Reading and writing stay as they are, so it ends up as 755.
Task 1/1: Make deploy.sh executable for everyone. Reading and writing stay as they are, so it ends up as 755.
Make deploy.sh executable for everyone. Reading and writing stay as they are, so it ends up as 755.
Task complete
Solution
chmod +x deploy.sh Why: Programs create files without the right to run them. That x is a decision someone makes on purpose.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
secrets.env holds a token, and right now everyone on the machine can read it. Make it readable and writable for you only.
Task 1/1: secrets.env holds a token, and right now everyone on the machine can read it. Make it readable and writable for you only.
secrets.env holds a token, and right now everyone on the machine can read it. Make it readable and writable for you only.
Task complete
Solution
chmod 600 secrets.env Why: Tools such as ssh refuse key files that others may read, for exactly this reason.
Another way
chmod go-r secrets.env Letters only take away what was there. The number sets the end result, whatever the file looked like before. For secrets the number is the safer habit.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
deploy.sh should belong to the group adm, so that the admins can read it as a team. You stay the owner.
Task 1/1: deploy.sh should belong to the group adm, so that the admins can read it as a team. You stay the owner.
deploy.sh should belong to the group adm, so that the admins can read it as a team. You stay the owner.
Task complete
Solution
chgrp adm deploy.sh Why: You may hand a file of yours to a group you belong to. Giving it to another user is something only root may do, because otherwise you could plant files on someone else.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Set the umask to 027 and create the empty file private.txt in the same shell. Group may read, others get nothing.
Task 1/1: Set the umask to 027 and create the empty file private.txt in the same shell. Group may read, others get nothing.
Set the umask to 027 and create the empty file private.txt in the same shell. Group may read, others get nothing.
Task complete
Solution
umask 027
touch private.txt Why: 027 is the common choice on hardened servers. The mask works when a file is created, not afterwards.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
handover.txt belongs to you, and it should belong to root. Give it away with one command.
Task 1/1: handover.txt belongs to you, and it should belong to root. Give it away with one command.
handover.txt belongs to you, and it should belong to root. Give it away with one command.
Task complete
Solution
sudo chown root handover.txt Why: A single command as root, and the log knows who ran it. The rest of the session stays yours.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Read the rule in /etc/sudoers.d/90-lerner that lets you use sudo without a password here.
Task 1/1: Read the rule in /etc/sudoers.d/90-lerner that lets you use sudo without a password here.
Read the rule in /etc/sudoers.d/90-lerner that lets you use sudo without a password here.
Task complete
Solution
sudo cat /etc/sudoers.d/90-lerner Why: Reading is allowed, editing is a job for visudo. Whoever may run everything without a password has root in practice, so such a line should be rare on a real machine.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
The CPU is at its limit. Show the processes so that you can see which one uses the most. Its PID is what you are after.
Task 1/1: The CPU is at its limit. Show the processes so that you can see which one uses the most. Its PID is what you are after.
The CPU is at its limit. Show the processes so that you can see which one uses the most. Its PID is what you are after.
Task complete
Solution
ps aux --sort=-%cpu Why: A %CPU of 397 means nearly four cores, which is possible on a machine with four. The first line tells you who to look at.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
python3 report.py has PID 3021 and is no longer needed. End it politely. The other processes keep running.
Task 1/1: python3 report.py has PID 3021 and is no longer needed. End it politely. The other processes keep running.
python3 report.py has PID 3021 and is no longer needed. End it politely. The other processes keep running.
Task complete
Solution
kill 3021 Why: TERM gives the process the chance to clean up. And you only hit this one PID, not everything that is also called python3.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Start sleep 300 in the background so that your prompt stays free, then show your list of jobs.
Task 1/1: Start sleep 300 in the background so that your prompt stays free, then show your list of jobs.
Start sleep 300 in the background so that your prompt stays free, then show your list of jobs.
Task complete
Solution
sleep 300 &
jobs Why: The list belongs to your shell. Another terminal has its own jobs, and ps is what shows everything on the machine.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Start sleep 300 so that it would survive closing the terminal, in the background.
Task 1/1: Start sleep 300 so that it would survive closing the terminal, in the background.
Start sleep 300 so that it would survive closing the terminal, in the background.
Task complete
Solution
nohup sleep 300 &
jobs Why: nohup alone would block your prompt, and & alone would die with the terminal. It takes both.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Which main process does nginx have? Show the status of the service. It needs no sudo.
Task 1/1: Which main process does nginx have? Show the status of the service. It needs no sudo.
Which main process does nginx have? Show the status of the service. It needs no sudo.
Task complete
Solution
systemctl status nginx Why: The status also shows the latest log lines. That makes it the first look when a service acts up.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Maintenance. Stop the service app. nginx keeps running.
Task 1/1: Maintenance. Stop the service app. nginx keeps running.
Maintenance. Stop the service app. nginx keeps running.
Task complete
Solution
sudo systemctl stop app Why: systemd now knows this was intended, and it does not start the service again until someone asks it to.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
The service backup is stopped and disabled. It should run now and after every reboot.
Task 1/1: The service backup is stopped and disabled. It should run now and after every reboot.
The service backup is stopped and disabled. It should run now and after every reboot.
Task complete
Solution
sudo systemctl enable --now backup Why: Enabled and active are two separate questions. A service can be running without coming back after a reboot, and the other way round.
Another way
sudo systemctl enable backup
sudo systemctl start backup Two lines with the same effect. The form with --now is shorter and cannot forget the second step.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Someone is worried about the memory of this machine. Show the overview in readable units.
Task 1/1: Someone is worried about the memory of this machine. Show the overview in readable units.
Someone is worried about the memory of this machine. Show the overview in readable units.
Task complete
Solution
free -h Why: Look at the last column first. 8.3 GiB available means that programs have plenty of room, even with only 921 MiB under free.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
free gets its numbers from a file that the kernel provides. Print that file and look for the line MemAvailable.
Task 1/1: free gets its numbers from a file that the kernel provides. Print that file and look for the line MemAvailable.
free gets its numbers from a file that the kernel provides. Print that file and look for the line MemAvailable.
Task complete
Solution
cat /proc/meminfo Why: 8703181 KiB is the 8.3 GiB from free -h. On a real server, grep MemAvailable /proc/meminfo picks out the one line, for example in a script.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Find out which swap area this machine uses. Plain swapon --show will fail, and the text says why.
Task 1/1: Find out which swap area this machine uses. Plain swapon --show will fail, and the text says why.
Find out which swap area this machine uses. Plain swapon --show will fail, and the text says why.
Task complete
Solution
/usr/sbin/swapon --show Why: command not found does not always mean that a program is missing, only that the shell does not look for it there. cat /proc/swaps is the same thing without the path: it is the file that swapon reads.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show all processes so that the one occupying the most memory is at the top.
Task 1/1: Show all processes so that the one occupying the most memory is at the top.
Show all processes so that the one occupying the most memory is at the top.
Task complete
Solution
ps aux --sort=-%mem Why: python3 app.py has 33 % of the RAM. With --sort=-vsz the Java process would be at the top, even though it occupies far less.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Mission
In the night, the app disappeared. Prove with the kernel log that the OOM killer did it. You are looking for the line Killed process 4711.
Task 1/1: In the night, the app disappeared. Prove with the kernel log that the OOM killer did it. You are looking for the line Killed process 4711.
Mission
In the night, the app disappeared. Prove with the kernel log that the OOM killer did it. You are looking for the line Killed process 4711.
Task complete
Solution
journalctl -k --no-pager Why: That is a proof, not a guess: the kernel names the PID, the program and how much memory it had. On a real server, sudo dmesg | grep -i oom gets you to the same line.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Now the view of the service. Show what the journal says about app, and find the result of the failure.
Task 1/1: Now the view of the service. Show what the journal says about app, and find the result of the failure.
Now the view of the service. Show what the journal says about app, and find the result of the failure.
Task complete
Solution
journalctl -u app --no-pager Why: Two independent witnesses, the kernel and systemd, say the same thing. On a real server, systemctl status app shows this result too.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
The chat says the disk is full. Confirm it first. How full is the file system that / is on?
Task 1/1: The chat says the disk is full. Confirm it first. How full is the file system that / is on?
The chat says the disk is full. Confirm it first. How full is the file system that / is on?
Task complete
Solution
df -h / Why: 97 % of 40 GiB, and only 1.4 GiB are left. Now you know that the alarm is real, and which file system it is about.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Find the file that takes up the space. Start at /var and follow the biggest number, level by level, down to the files.
Task 1/1: Find the file that takes up the space. Start at /var and follow the biggest number, level by level, down to the files.
Find the file that takes up the space. Start at /var and follow the biggest number, level by level, down to the files.
Task complete
Solution
du -h -d 1 /var 2>/dev/null
du -ah /var/log/app Why: 29G in an old, rotated log. On a real server, du -sh /var/* 2>/dev/null | sort -rh | head takes you there faster, but it needs sort and head, and those are not on this page.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Which partition is / on? Show the block devices or the mount point, whichever you prefer.
Task 1/1: Which partition is / on? Show the block devices or the mount point, whichever you prefer.
Which partition is / on? Show the block devices or the mount point, whichever you prefer.
Task complete
Solution
lsblk Why: sda1 is part of sda and appears as /. Reading this needs no sudo. Changing anything does.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Pack the folder projects/shop into a compressed archive called shop.tar.gz in your home folder. Then make sure of what is in it.
Task 1/1: Pack the folder projects/shop into a compressed archive called shop.tar.gz in your home folder. Then make sure of what is in it.
Pack the folder projects/shop into a compressed archive called shop.tar.gz in your home folder. Then make sure of what is in it.
Task complete
Solution
tar -czf shop.tar.gz projects/shop
tar -tzf shop.tar.gz Why: The order is the point. The name of the archive comes first, right after -f, and the things to pack come after that. Swapping them is how people lose files.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Mirror the contents of projects/shop to a folder mirror in your home folder, so that app.conf ends up directly in mirror.
Task 1/1: Mirror the contents of projects/shop to a folder mirror in your home folder, so that app.conf ends up directly in mirror.
Mirror the contents of projects/shop to a folder mirror in your home folder, so that app.conf ends up directly in mirror.
Task complete
Solution
rsync -av projects/shop/ mirror/ Why: With the slash, the contents land in mirror. Without it, you would get mirror/shop/app.conf. Run the same line again, and rsync transfers nothing, because nothing differs.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Which address does this server have on its real network card? Show the interfaces.
Task 1/1: Which address does this server have on its real network card? Show the interfaces.
Which address does this server have on its real network card? Show the interfaces.
Task complete
Solution
ip -br a Why: 203.0.113.10 on eth0. The 127.0.0.1 on lo is the loopback and only exists inside the machine, so that is not the address anybody else can reach.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Where does the traffic go that does not stay in the own network? Show the default gateway.
Task 1/1: Where does the traffic go that does not stay in the own network? Show the default gateway.
Where does the traffic go that does not stay in the own network? Show the default gateway.
Task complete
Solution
ip route Why: default via 203.0.113.1 is the gateway. Without this line the server only reaches its own network, 203.0.113.0/24.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Check whether the gateway 203.0.113.1 answers. Send exactly three packets, so that ping stops by itself.
Task 1/1: Check whether the gateway 203.0.113.1 answers. Send exactly three packets, so that ping stops by itself.
Check whether the gateway 203.0.113.1 answers. Send exactly three packets, so that ping stops by itself.
Task complete
Solution
ping -c 3 203.0.113.1 Why: Three out, three back, no loss. The way to the gateway works. A real server could still drop ping on purpose, so a missing answer would not have been a proof of the opposite.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Mission
Find out with ss which process listens on port 8080, and on which address.
Task 1/1: Find out with ss which process listens on port 8080, and on which address.
Mission
Find out with ss which process listens on port 8080, and on which address.
Task complete
Solution
ss -tlnp Why: python3 app.py, PID 2114, on 127.0.0.1:8080. It listens, but only on the loopback, so nobody outside the machine can reach it.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
The process column is empty for port 22 and port 80. Show the listening TCP sockets with the processes of every user.
Task 1/1: The process column is empty for port 22 and port 80. Show the listening TCP sockets with the processes of every user.
The process column is empty for port 22 and port 80. Show the listening TCP sockets with the processes of every user.
Task complete
Solution
sudo ss -tlnp Why: sshd with PID 612 on port 22, nginx with PID 701 on port 80. Reading needs root here because the processes are not yours, and on a real server sudo would ask for your password first.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Does shop.example.net/missing exist? Find the status code of the answer.
Task 1/1: Does shop.example.net/missing exist? Find the status code of the answer.
Does shop.example.net/missing exist? Find the status code of the answer.
Task complete
Solution
curl -I shop.example.net/missing Why: 404 Not Found. The server is there and answers, but there is no page under this path. A 4xx is never a sign that the server is down.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Which address is behind api.example.com? Ask the DNS, and only the address, please.
Task 1/1: Which address is behind api.example.com? Ask the DNS, and only the address, please.
Which address is behind api.example.com? Ask the DNS, and only the address, please.
Task complete
Solution
dig +short api.example.com Why: 203.0.113.10, this server itself, the address on eth0. So the name points where it should, and the chat was wrong this time.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Ask the DNS server 203.0.113.53 directly which address shop.example.net has.
Task 1/1: Ask the DNS server 203.0.113.53 directly which address shop.example.net has.
Ask the DNS server 203.0.113.53 directly which address shop.example.net has.
Task complete
Solution
dig @203.0.113.53 shop.example.net Why: 198.51.100.7, in the ANSWER SECTION, and the first line of the output repeats whom you asked. With @ you decide whom you ask. If another server answered differently, you would know that the DNS itself is the problem.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
web-02 is not in the DNS. Find its address the way the system and your programs look it up.
Task 1/1: web-02 is not in the DNS. Find its address the way the system and your programs look it up.
web-02 is not in the DNS. Find its address the way the system and your programs look it up.
Task complete
Solution
getent hosts web-02 Why: 198.51.100.20 from /etc/hosts. dig +short web-02 stays empty, because the DNS has never heard of the name.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Does the disk check still run? Show your crontab.
Task 1/1: Does the disk check still run? Show your crontab.
Does the disk check still run? Show your crontab.
Task complete
Solution
crontab -l Why: */15 * * * * /home/lerner/bin/check-disk.sh: every 15 minutes, every hour, every day. Whether it really ran is in the journal, and that is two exercises further on.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Add a second job without an editor. /home/lerner/bin/check-disk.sh should also run every day at 02:30. The job every 15 minutes stays.
Task 1/1: Add a second job without an editor. /home/lerner/bin/check-disk.sh should also run every day at 02:30. The job every 15 minutes stays.
Add a second job without an editor. /home/lerner/bin/check-disk.sh should also run every day at 02:30. The job every 15 minutes stays.
Task complete
Solution
crontab -l > cron.txt
echo '30 2 * * * /home/lerner/bin/check-disk.sh' >> cron.txt
crontab cron.txt Why: crontab FILE replaces the whole crontab. That is why the old line has to be in the file too. With > instead of >> in the second step, the job every 15 minutes would be gone.
Another way
(crontab -l; echo '30 2 * * * /home/lerner/bin/check-disk.sh') | crontab - One line instead of three, but without the file in between, which you could have looked at before installing it.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Did cron really start the check? Show the last lines that the service cron wrote to the journal.
Task 1/1: Did cron really start the check? Show the last lines that the service cron wrote to the journal.
Did cron really start the check? Show the last lines that the service cron wrote to the journal.
Task complete
Solution
journalctl -u cron -n 10 Why: The last CMD line for lerner is from 09:15. Every quarter of an hour the same three lines, so the job is started. Whether the script itself succeeded is what its own output would say.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
What went wrong today? Show only the errors in the journal.
Task 1/1: What went wrong today? Show only the errors in the journal.
What went wrong today? Show only the errors in the journal.
Task complete
Solution
journalctl -p err Why: One error at 08:52, from the app, not from cron. -p err shows errors and everything worse, so a crit or an emerg would be there too.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
A security notice is about curl. Which version of curl is installed?
Task 1/1: A security notice is about curl. Which version of curl is installed?
A security notice is about curl. Which version of curl is installed?
Task complete
Solution
apt show curl Why: 8.14.1-2+deb13u7 from trixie-security. The +deb13u7 is the seventh update of Debian 13 for this package. Compare it with the version named in the notice, and update with sudo apt update and sudo apt upgrade on a real server.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Create an account for Mia, user name mia, with a home folder, and in the group adm so that she can read the logs.
Task 1/1: Create an account for Mia, user name mia, with a home folder, and in the group adm so that she can read the logs.
Create an account for Mia, user name mia, with a home folder, and in the group adm so that she can read the logs.
Task complete
Solution
sudo useradd -m -s /bin/bash -G adm mia Why: id mia now shows the group adm, and /home/mia exists. Without -m, Debian would have created no home folder, and mia would land in / after logging in.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Which groups is the account gast in? Show it.
Task 1/1: Which groups is the account gast in? Show it.
Which groups is the account gast in? Show it.
Task complete
Solution
id gast Why: Only its own group gast, 1001. So gast may neither read the logs nor use sudo.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Which kernel release runs on this machine?
Task 1/1: Which kernel release runs on this machine?
Which kernel release runs on this machine?
Task complete
Solution
uname -r Why: 6.12.48+deb13-amd64, a Debian 13 kernel for 64-bit PCs and servers. On a real machine, this is the number that changes after a kernel update and a reboot.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Which distribution is this? Read /etc/os-release into the shell and print the variable PRETTY_NAME. cat is not on this page.
Task 1/1: Which distribution is this? Read /etc/os-release into the shell and print the variable PRETTY_NAME. cat is not on this page.
Which distribution is this? Read /etc/os-release into the shell and print the variable PRETTY_NAME. cat is not on this page.
Task complete
Solution
. /etc/os-release
echo "$PRETTY_NAME" Why: Debian GNU/Linux 13 (trixie). Scripts use exactly this trick to find out where they run, and on RHEL the same lines would say Red Hat Enterprise Linux.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Make the alias kver for uname -r permanent, so that every new session has it. It belongs in ~/.bashrc.
Task 1/1: Make the alias kver for uname -r permanent, so that every new session has it. It belongs in ~/.bashrc.
Make the alias kver for uname -r permanent, so that every new session has it. It belongs in ~/.bashrc.
Task complete
Solution
echo "alias kver='uname -r'" >> ~/.bashrc
source ~/.bashrc Why: The line is in ~/.bashrc, and every new bash reads it. source ~/.bashrc brings it into this session too, and type kver confirms it.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Ask the computer which user you are working as.
Task 1/1: Ask the computer which user you are working as.
Ask the computer which user you are working as.
Task complete
Solution
whoami Why: Before you change anything on a computer, it helps to know as whom you are doing it. whoami answers that in one word.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Go into the folder Downloads, then show with pwd where you are now.
Task 1/1: Go into the folder Downloads, then show with pwd where you are now.
Go into the folder Downloads, then show with pwd where you are now.
Task complete
Solution
cd Downloads
pwd Why: cd is silent when it works. pwd is the quick check that you landed where you wanted.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
List your home folder so that the hidden files appear as well.
Task 1/1: List your home folder so that the hidden files appear as well.
List your home folder so that the hidden files appear as well.
Task complete
Solution
ls -a Why: Settings often live in hidden files like .bashrc. When something behaves oddly, ls -a shows you what else is there.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Jump into the folder website inside projects, then show with pwd where you are.
Task 1/1: Jump into the folder website inside projects, then show with pwd where you are.
Jump into the folder website inside projects, then show with pwd where you are.
Task complete
Solution
cd /home/lerner/projects/website
pwd Why: With a full path you jump in one step instead of walking folder by folder.
Another way
cd projects/website
pwd The relative path is shorter, but only works from your home folder. The absolute path works from anywhere.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show the content of the file Holiday 2027.txt in the folder Documents.
Task 1/1: Show the content of the file Holiday 2027.txt in the folder Documents.
Show the content of the file Holiday 2027.txt in the folder Documents.
Task complete
Solution
cat "Documents/Holiday 2027.txt" Why: Without quotes the shell would split the name at the space and look for two files that do not exist.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Create a folder called music in your home folder.
Task 1/1: Create a folder called music in your home folder.
Create a folder called music in your home folder.
Task complete
Solution
mkdir music Why: mkdir gives you a place for new things before you have them. Order first, content later.
Another way
ls
mkdir music One line more, but you see first that the name is still free.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Create the folder src inside projects/app. The folder app does not exist yet. Use one command.
Task 1/1: Create the folder src inside projects/app. The folder app does not exist yet. Use one command.
Create the folder src inside projects/app. The folder app does not exist yet. Use one command.
Task complete
Solution
mkdir -p projects/app/src Why: Real projects have deep folder structures. mkdir -p sets them up in one line.
Another way
mkdir projects/app
mkdir projects/app/src Works too, but needs one command per level. With deep paths, -p saves a lot of typing.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Create an empty file ideas.txt in the folder Documents.
Task 1/1: Create an empty file ideas.txt in the folder Documents.
Create an empty file ideas.txt in the folder Documents.
Task complete
Solution
touch Documents/ideas.txt Why: An empty file is a placeholder. Some programs only start working once a certain file exists.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show the last 5 lines of the log projects/website/server.log.
Task 1/1: Show the last 5 lines of the log projects/website/server.log.
Show the last 5 lines of the log projects/website/server.log.
Task complete
Solution
tail -n 5 projects/website/server.log Why: In a log, the newest entries are at the bottom. tail shows what happened last without scrolling through everything.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show only the first 2 lines of the letter Documents/letter.txt.
Task 1/1: Show only the first 2 lines of the letter Documents/letter.txt.
Show only the first 2 lines of the letter Documents/letter.txt.
Task complete
Solution
head -n 2 Documents/letter.txt Why: The first lines often tell you what a file is about, without reading all of it.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Move photo.jpg from Downloads into the folder Pictures.
Task 1/1: Move photo.jpg from Downloads into the folder Pictures.
Move photo.jpg from Downloads into the folder Pictures.
Task complete
Solution
mv Downloads/photo.jpg Pictures/ Why: The photo is then in one place only. With cp you would have two copies and would have to tidy up again.
Another way
ls Pictures
mv -i Downloads/photo.jpg Pictures/ Looking first and adding -i costs a few seconds and protects a photo with the same name in the target.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Make a backup of the folder projects/website with everything in it. The copy should be called projects/website-backup.
Task 1/1: Make a backup of the folder projects/website with everything in it. The copy should be called projects/website-backup.
Make a backup of the folder projects/website with everything in it. The copy should be called projects/website-backup.
Task complete
Solution
cp -r projects/website projects/website-backup Why: A backup before a change is your undo button. If something goes wrong, the old state is still there.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Copy notes.txt from your home folder into Documents. An older notes.txt already lies there and must stay unchanged, so give the copy the name notes-new.txt.
Task 1/1: Copy notes.txt from your home folder into Documents. An older notes.txt already lies there and must stay unchanged, so give the copy the name notes-new.txt.
Copy notes.txt from your home folder into Documents. An older notes.txt already lies there and must stay unchanged, so give the copy the name notes-new.txt.
Task complete
Solution
cp notes.txt Documents/notes-new.txt Why: Copying straight into Documents/ would have replaced the older notes without a word. A new name keeps both.
Another way
ls Documents
cp -i notes.txt Documents/notes-new.txt First ls shows that notes-new.txt is still free, and -i would ask if it were not. Two safety nets for one line more.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Documents/notes.txt is an old copy of your notes with just one line. Look at it, then delete it. Everything else stays.
Task 1/1: Documents/notes.txt is an old copy of your notes with just one line. Look at it, then delete it. Everything else stays.
Documents/notes.txt is an old copy of your notes with just one line. Look at it, then delete it. Everything else stays.
Task complete
Solution
cat Documents/notes.txt
rm Documents/notes.txt Why: One look costs a second. Without it you might delete the wrong notes, and rm has no undo.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Delete every .jpg file in Downloads with one pattern. Check first with ls which files the pattern matches. The PDF and the pictures in Pictures stay.
Task 1/1: Delete every .jpg file in Downloads with one pattern. Check first with ls which files the pattern matches. The PDF and the pictures in Pictures stay.
Delete every .jpg file in Downloads with one pattern. Check first with ls which files the pattern matches. The PDF and the pictures in Pictures stay.
Task complete
Solution
ls Downloads/*.jpg
rm Downloads/*.jpg Why: ls and rm see exactly the same list for the same pattern. If ls shows the right files, rm deletes the right files.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
The old website in projects/website is no longer needed. Delete the folder with everything in it. The folder projects itself stays.
Task 1/1: The old website in projects/website is no longer needed. Delete the folder with everything in it. The folder projects itself stays.
The old website in projects/website is no longer needed. Delete the folder with everything in it. The folder projects itself stays.
Task complete
Solution
ls projects/website
rm -r projects/website Why: rm -r takes everything inside without asking. A quick ls first shows you what that is.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Find out where the program date lives. Let the terminal show you its full path.
Task 1/1: Find out where the program date lives. Let the terminal show you its full path.
Find out where the program date lives. Let the terminal show you its full path.
Task complete
Solution
which date Why: If a command behaves strangely, the first question is which program actually runs. which answers it in one line.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
cat projects/website/index.htm answers "No such file or directory". Find the right name with ls and show the file.
Task 1/1: cat projects/website/index.htm answers "No such file or directory". Find the right name with ls and show the file.
cat projects/website/index.htm answers "No such file or directory". Find the right name with ls and show the file.
Task complete
Solution
cat projects/website/index.htm
ls projects/website
cat projects/website/index.html Why: "No such file or directory" almost always means a typo. ls on the folder shows the real names, and the mistake jumps out.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show the short help of touch, right in the terminal, without full screen.
Task 1/1: Show the short help of touch, right in the terminal, without full screen.
Show the short help of touch, right in the terminal, without full screen.
Task complete
Solution
touch --help Why: --help is the fastest way to look up a forgotten option. You stay at the prompt and can type the command right away.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show the holiday plan in Documents with cat. Let Tab write the name: cat Doc, Tab, Hol, Tab, Enter.
Task 1/1: Show the holiday plan in Documents with cat. Let Tab write the name: cat Doc, Tab, Hol, Tab, Enter.
Show the holiday plan in Documents with cat. Let Tab write the name: cat Doc, Tab, Hol, Tab, Enter.
Task complete
Solution
cat Documents/Holiday\ 2027.txt Why: Names with spaces are easy to get wrong by hand. Tab adds the backslash for you, so the name stays in one piece.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Run grep 404 projects/website/server.log. Then bring the line back with the up arrow, add > errors.txt at the end and press Enter. The hits should end up in errors.txt in your home folder.
Task 1/1: Run grep 404 projects/website/server.log. Then bring the line back with the up arrow, add > errors.txt at the end and press Enter. The hits should end up in errors.txt in your home folder.
Run grep 404 projects/website/server.log. Then bring the line back with the up arrow, add > errors.txt at the end and press Enter. The hits should end up in errors.txt in your home folder.
Task complete
Solution
grep 404 projects/website/server.log
grep 404 projects/website/server.log > errors.txt Why: First look at the result on the screen, then save it to a file. The up arrow makes the second step one short addition.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show the first 3 lines of projects/website/server.log with head -n 3. Clear the screen with Ctrl-L. Then press Ctrl-R, type head and press Enter to run the line again.
Task 1/1: Show the first 3 lines of projects/website/server.log with head -n 3. Clear the screen with Ctrl-L. Then press Ctrl-R, type head and press Enter to run the line again.
Show the first 3 lines of projects/website/server.log with head -n 3. Clear the screen with Ctrl-L. Then press Ctrl-R, type head and press Enter to run the line again.
Task complete
Solution
head -n 3 projects/website/server.log
clear
head -n 3 projects/website/server.log Why: Ctrl-R finds a line even if you ran fifty others since. You only need to remember a piece of it.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Which lines of projects/website/server.log contain 404? Show them with their line numbers.
Task 1/1: Which lines of projects/website/server.log contain 404? Show them with their line numbers.
Which lines of projects/website/server.log contain 404? Show them with their line numbers.
Task complete
Solution
grep -n 404 projects/website/server.log Why: With the line number you can jump straight to the spot later, for example in less or an editor.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
In how many lines of Documents/recipes.txt does garlic appear, written small or with a capital letter? Let grep count.
Task 1/1: In how many lines of Documents/recipes.txt does garlic appear, written small or with a capital letter? Let grep count.
In how many lines of Documents/recipes.txt does garlic appear, written small or with a capital letter? Let grep count.
Task complete
Solution
grep -ic garlic Documents/recipes.txt Why: Without -i the line "Garlic bread" would be missing. Small letters and capitals are different characters for grep.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Show all lines of projects/website/server.log that are not a GET request.
Task 1/1: Show all lines of projects/website/server.log that are not a GET request.
Show all lines of projects/website/server.log that are not a GET request.
Task complete
Solution
grep -v GET projects/website/server.log Why: Hiding what you already know leaves the unusual lines. In a big log those are often the interesting ones.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Find every .jpg file in your home folder and all folders below it, with find.
Task 1/1: Find every .jpg file in your home folder and all folders below it, with find.
Find every .jpg file in your home folder and all folders below it, with find.
Task complete
Solution
find . -name '*.jpg' Why: You do not need to know where a file is. find looks in every folder below the start for you.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
How many requests in projects/website/server.log ended in 404? Find them with grep and count them with wc -l, joined by a pipe.
Task 1/1: How many requests in projects/website/server.log ended in 404? Find them with grep and count them with wc -l, joined by a pipe.
How many requests in projects/website/server.log ended in 404? Find them with grep and count them with wc -l, joined by a pipe.
Task complete
Solution
grep 404 projects/website/server.log | wc -l Why: wc counts anything you hand it. With a pipe it works for every command that prints lines, not only for grep.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Add the line "Pay the rent" at the end of notes.txt. The three lines that are already there stay.
Task 1/1: Add the line "Pay the rent" at the end of notes.txt. The three lines that are already there stay.
Add the line "Pay the rent" at the end of notes.txt. The three lines that are already there stay.
Task complete
Solution
echo "Pay the rent" >> notes.txt Why: With a single > the file would only contain "Pay the rent". The second > is the difference between adding and replacing.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Merge notes.txt and Documents/notes.txt into one sorted list without duplicate lines. Save it as all-notes.txt in your home folder. Both note files stay as they are.
Task 1/1: Merge notes.txt and Documents/notes.txt into one sorted list without duplicate lines. Save it as all-notes.txt in your home folder. Both note files stay as they are.
Merge notes.txt and Documents/notes.txt into one sorted list without duplicate lines. Save it as all-notes.txt in your home folder. Both note files stay as they are.
Task complete
Solution
ls all-notes.txt
sort notes.txt Documents/notes.txt | uniq > all-notes.txt Why: The result goes into a new file, so the two originals stay untouched. If something is wrong, you just run it again.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
Tidy up Downloads. Create the folders invoices and photos in Downloads. Delete the duplicates with (1) in the name; in this exercise they are given as identical copies of their originals. Move the three invoices into invoices and the two photos into photos. Delete the two unfinished .part downloads. tax-return-2025.pdf and rental-contract.pdf stay where they are, unchanged.
Task 1/1: Tidy up Downloads. Create the folders invoices and photos in Downloads. Delete the duplicates with (1) in the name; in this exercise they are given as identical copies of their originals. Move the three invoices into invoices and the two photos into photos. Delete the two unfinished .part downloads. tax-return-2025.pdf and rental-contract.pdf stay where they are, unchanged.
Tidy up Downloads. Create the folders invoices and photos in Downloads. Delete the duplicates with (1) in the name; in this exercise they are given as identical copies of their originals. Move the three invoices into invoices and the two photos into photos. Delete the two unfinished .part downloads. tax-return-2025.pdf and rental-contract.pdf stay where they are, unchanged.
Task complete
Solution
ls -l Downloads
mkdir Downloads/invoices Downloads/photos
find Downloads -name '*(1)*'
rm 'Downloads/beach(1).jpg' 'Downloads/invoice-2026-10(1).pdf'
ls Downloads/invoice-*.pdf
mv Downloads/invoice-*.pdf Downloads/invoices/
mv Downloads/*.jpg Downloads/photos/
ls -l Downloads/*.part
rm Downloads/*.part Why: Small steps you can check beat one clever line. If something looks wrong after a step, you notice it before rm makes it permanent.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet
Terminal task
The file old-draft.txt in Documents is no longer needed. Delete it and keep notes.txt.
Task 1/1: The file old-draft.txt in Documents is no longer needed. Delete it and keep notes.txt.
The file old-draft.txt in Documents is no longer needed. Delete it and keep notes.txt.
Task complete
Solution
rm Documents/old-draft.txt Why: rm removes the name of the file at once. There is no recycle bin in the terminal.
Another way
ls Documents
rm Documents/old-draft.txt One line more, but you see the exact name before you delete. On a real system that is the safer habit.
See the solution? You get fewer XP for this task.
Start over? Files, folders and output go back to the start. Your hints stay.
Loading terminal …
Esc, then Tab leaves the terminal
Not done yet