

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: What Is a Filesystem?
incomplete
2: Filepaths
incomplete
3: Parent Directories
incomplete
4: Absolute vs. Relative Paths
incomplete
5: Files
incomplete
6: Tab Completion
incomplete
7: head and tail
incomplete
8: More and Less
incomplete
9: Touch
incomplete
10: Directories
incomplete
11: Move
incomplete
12: Remove
incomplete
13: Copy
incomplete
14: Home
incomplete
15: Grep
incomplete
16: grep Multiple Files
incomplete
17: Find
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Typing out long file paths is slow and boring. That's where the Tab key becomes your friend! If you start typing the name of a file or directory and then hit Tab, your shell will try to autocomplete the name for you.
To demonstrate, you can start typing ls w, then press Tab:
ls w
# ls worldbanc/
Since worldbanc is (presumably) the only match, the rest gets filled in for you.
Continue typing, adding p, then press Tab again:
ls worldbanc/p
# private public
Since both worldbanc/private/ and worldbanc/public/ match worldbanc/p, the shell lists them. You can type either r or u to narrow the match. In some shells, you may need to press Tab again to see a list of options.
ls worldbanc/pr
# ls worldbanc/private/
pr is just specific enough to match worldbanc/private/!
I rarely type out full file names. I type the first few characters and press Tab.
Tab completion also works for commands. For example, if clear is the only command your shell is aware of that matches cl, typing cl and then hitting Tab will complete it to clear.
Many CLI tools support tab completion for their own subcommands and options. A popular example is git. Getting completions for a tool often requires enabling a script in your shell configuration file. We'll explain shell configuration down the road.
Use tab completion to view one of WorldBanc's loan products without typing the full path:
cat worldbanc/public/products/loans/sbloc.txt
Submit the shell checks.