LINUX · Start here · 5 min
Build a useful directory layout
Create folders and a small status file in a Linux shell.
Not completedYour task
Create reports/archive and write ready on its own line in reports/current.txt.
What you’re aiming for
- reports/archive is a directory.
- reports/current.txt contains ready.
1. Prepare your practice folder
Use a Linux terminal, such as Ubuntu or WSL on Windows. These examples use Linux file permissions. In WSL, create your practice folder in your Linux home directory (~).
Create a new, empty folder for this exercise. If that name already exists, choose another new name. Continue only after you’re inside the new folder.
mkdir opsrung-linux-organize-files && cd opsrung-linux-organize-files
This task starts with an empty folder; no starter files are needed.
2. Try the task
Work toward the goal above. Start by inspecting the files or resources, then use a hint if you need one.
Hint 1
Work inside the new empty practice folder you created in step 1.
Hint 2
mkdir -p can create more than one directory level.
Hint 3
Use printf to put a short line into a file.
3. Review your result
Use these commands to look at your result and compare it with the goals. The website does not run or verify them.
ls -ld reports/archive cat reports/current.txt
What you should see
- ls -ld reports/archive shows a directory; its permission field begins with d.
- cat reports/current.txt prints ready on its own line.
If your result differs: If the path does not exist, create the parent folders with mkdir -p before writing the file. Work inside your practice folder.
Compare with one possible solution
mkdir -p reports/archive printf 'ready\n' > reports/current.txt
Other approaches are fine if you reach the same goal. Opening this solution does not mark the exercise complete.
Finished this exercise?
You decide when you’re done. Your choice is saved in this browser, and you can change it later.