Short task: tidy a messy project folder and find the missing file
You sort a project folder where everything was dumped into one directory into subdirectories by type, clean up leftover files scattered down into subdirectories, find a handover note forgotten elsewhere on the server and put it in place, repoint a broken link to the newest log and verify the result by counting. You decide which commands to use.
Level 101 · 30 min
At Northwind a project team was dissolved and its folder was handed to you. It is a proper junk drawer: logs, tables, notes, backup copies and temporary files all in one place. On top of that the team’s handover note isn’t in the folder; someone saved it somewhere else on the server.
This is a short task: no commands are given, only goals. You may use everything from this section: mkdir, mv, cp, rm, wildcards (*, ?, [ ]), brace expansion, find (name, type, -delete), ls -t, ln -s, readlink, tree, wc -l.
The project’s path is written in ~/project.txt; the project, the file counts, the lost file’s place and the newest log differ in every lab. Tidiness is not a luxury for security: on a server where you don’t know what is where, you can’t know what is missing or extra either.
The golden rule: list before you delete. Run a wildcard or find expression only to look first; if the result is right, apply the action.
What you will do in this lesson
- Sort by type
- Clean up the leftovers
- Find the lost handover note
- Point the link at the newest log
- Count and record the result
- Short quiz
Skills you will earn
- Creating nested directories (mkdir -p)
- Moving files (mv)
- Selecting files with a wildcard (*)
- Quoting rules and names with special characters
- Searching files by name (find -name, -type)
- Deleting safely with find (-mtime, -delete)
- Previewing before deleting with a pattern
- Writing a short, precise finding
- Sorting files by modification time (ls -lt)
- Reading and fixing symbolic links (readlink, ln -sfn)
- Viewing a folder tree (tree, find -maxdepth)
- Counting lines (wc -l)
← Reading contents: cat, less, head, tail -f · Linux fundamentals · Redirection, stdout and stderr, and pipes →
Start for free