Filesystem Walk
You'll follow the Linux directory tree from the root down with a map in one hand, find where the configuration really lives, and mount a drive by hand.
About
Linux puts everything, including hardware and running programs, in one tree that starts at a single slash. Once you know that /etc holds the settings, /var holds the things that grow, /proc is the kernel talking, and /dev is your hardware pretending to be files, most error messages start to make sense. This badge is a guided walk through that tree with the man page for hier as the map. The one trap is running commands as root while you explore, so stay a regular user tonight and look rather than touch. Moving around with cd and ls is the Terminal Footing badge in Coding, and this one assumes you can.
At a glance
- Per requirement
- 15 XP
- Completion bonus
- 75 XP
- Requirements
- 5
- Takes
- One evening
- Skill level
- Beginner (done it a few times)
- Cost
- Free
- Supplies
- You need some
- Where
- At home
- Other people
- On your own
Requirements
-
1
Read man hier and draw the top of the tree from memory. Run man hier (or man file-hierarchy on some systems) and read it end to end, which takes about twenty minutes. Then close it and draw the top-level directories on paper with one line each saying what lives there. Check your drawing against ls / afterwards. Take a photo of the drawing. Photo
-
2
Find the configuration file for a program you use, and the log it writes. Pick something like your shell, SSH or the package manager. Look in /etc, then in your home directory under the dotfiles and .config, and find the log in /var/log or in journalctl. Use find, grep or the package manager's file list to track them down rather than guessing. Take a photo of the terminal showing the paths you found. Photo
-
3
Read your hardware out of /proc and /sys. Run cat /proc/cpuinfo, cat /proc/meminfo, and cat /sys/class/power_supply/BAT0/capacity on a laptop. None of those are real files on disk, which is the point. Take a photo of the terminal showing your CPU model and your memory total. Photo
-
4
Mount a USB stick by hand and unmount it cleanly. Plug in a stick, run lsblk to find its name, then mount it to a directory you made with sudo mount /dev/sdX1 /mnt/stick. Write a file to it, run sync, then umount it before you pull it out, because pulling early is how files get half written. Film the whole thing, or take a photo of the terminal showing lsblk with the stick mounted and the umount line below it. Photo or video
-
5
Find the five biggest things on your disk. Use df -h to see how full each filesystem is, then du -sh on directories, or ncdu if it's installed, which is nicer. Most people find a cache or an old download folder they'd forgotten. Take a photo of the output, and say what you deleted, if anything. Photo