Terminal Footing
You'll move around your computer from the terminal without touching the mouse, using the dozen commands that cover most of a year's work.
About
The terminal does exactly what you type and nothing more, which is why it looks unfriendly at first and why you can trust it completely. About twelve commands cover most of what you'll do in a year, and this badge gets you comfortable with them. You'll type ls forty times tonight, and that's completely normal. This badge is about using the shell, not scripting it, since writing scripts to do your chores is its own track next door.
At a glance
- Per requirement
- 15 XP
- Completion bonus
- 75 XP
- Requirements
- 6
- Takes
- One evening
- Skill level
- Novice (never tried it)
- Cost
- Free
- Supplies
- Nothing special
- Where
- At home
- Other people
- On your own
Requirements
-
1
Open a terminal and find out where you are, what's there, and what's hidden. Run pwd, then ls, then ls -la. The files starting with a dot that appear with -la are configuration files, so leave them alone for now and just know they exist. Take a screenshot showing the output of all three commands. Photo
-
2
Move into a folder three levels deep and back out using only relative paths. Use cd with .. to climb back up, and press tab to complete names as you go. Tab completion is the single biggest speed-up in the terminal, and most people take months to find it. Film a short clip of yourself moving down and back up without typing a full path. Video
-
3
Make a folder, create three files in it, rename one and delete one, all from the shell. The commands are mkdir, touch, mv and rm. Be careful with rm, because it has no undo and no trash can, so type the path, look at it, and only then press enter. Take a screenshot of ls after each step so we can see the folder change. Photo
-
4
Find every line containing a word across a whole folder of files. Use grep -r with the word and the folder name. Try it on a project you downloaded or on your own notes. Then add wc -l to the end of a pipe to count the matches. Take a screenshot of the command and the count it gives you. Photo
-
5
Chain three commands together with pipes to answer a real question. A good one is which words appear most often in a text file, which you can get with cat, tr, sort, uniq -c, sort -n and tail. Each program does one job and hands its output to the next, and that one idea is most of what Unix is. Take a screenshot of the pipeline and the answer it gave you. Photo
-
6
Read a man page or the --help output for one command and use a flag you didn't know. Try man ls or ls --help, and press q to get out of the manual when you're done. Pick one flag you've never used, use it, and explain what it did in one sentence. Take a screenshot of the flag in use with your sentence. Photo