Shell Typing Practice
Master Shell syntax with real-world code examples. Practice typing Shell code to boost your development speed and reduce syntax errors.
Start Shell PracticeWhy Practice Shell Typing?
Variables and Parameters
Master $variable, $1, $@, and parameter expansion syntax.
Pipes and Redirects
Practice | pipes, > output, and 2>&1 redirections.
Control Structures
Get comfortable with if/then/fi and for/do/done loops.
Command Substitution
Smoothly type $(command) and backtick substitution.
Common Shell Syntax
Practice these common Shell syntax patterns for smooth coding:
#!/bin/bashfor f in *.txt; doif [ -f "$file" ]; thenresult=$(command | grep)
Why practice typing Shell code?
Shell scripts pack more symbols into a single line than almost any other kind of code. A line such as grep -r "TODO" ~/src | wc -l > count.txt 2>&1 mixes double quotes, a tilde path, a pipe and redirection, and most of those characters need Shift. Shell commands are also typed straight into a terminal again and again, usually without an editor completing the punctuation for you, so every small hesitation on $, | or & adds up over a working day.
Shell is also strict about whitespace. A missing space inside [ ] or an extra space around = in an assignment is not a style problem: it changes the meaning of the line or causes a syntax error. Practicing until the correct spacing is in your fingers removes a whole class of bugs that are hard to spot when you only read the code.
DevType's Shell course uses realistic Bash snippets across levels 1 to 5, from single commands to complete scripts with functions, loops and error handling. Leading indentation is entered automatically and is not counted, so your attention goes to the characters that actually matter in shell: quotes, brackets, operators and the keywords then, fi, do and done.
Symbols you type often in Shell
"${VAR}"Quoted variable expansion
$ is Shift+4 on both US and JIS keyboards. The braces { } are Shift+[ and Shift+]: on US they sit right of P, on JIS they are the keys right of @ and :. Since 4 is a left-hand key, press it with the right Shift, then use the left Shift for the brace. The double quote is Shift+' next to Enter on US but Shift+2 on JIS, so JIS users type "${ with the left hand doing most of the work.
$(...)Command substitution
Parentheses are Shift+9 and Shift+0 on US, but Shift+8 and Shift+9 on JIS, one key further left. If you switch between layouts this is a classic source of typos. Prefer $(...) to backticks: it nests cleanly and is easier to read. The backtick is the top-left key on US and Shift+@ on JIS.
|Pipe
On a US ANSI keyboard | is Shift+\, the key above Enter. On JIS it is Shift+¥, at the right end of the number row. Both are right-pinky reaches. Type the pipe together with its surrounding spaces as one rhythm unit, space-pipe-space, instead of three separate decisions.
2>&1Redirecting stderr to stdout (with > and >>)
> is Shift+. on both layouts, and >> appends instead of overwriting. & is Shift+7 on US but Shift+6 on JIS. 2>&1 appears so often that it is worth practicing as one word with no spaces inside, so your fingers produce it without thinking about each character.
&& ||Conditional chaining (AND / OR)
&& runs the next command only if the previous one succeeded, and || runs it only if it failed. For doubled shifted characters, hold Shift down and tap the key twice rather than pressing Shift again for each character. | is Shift+\ on US and Shift+¥ on JIS; & is Shift+7 on US and Shift+6 on JIS.
[[ ... ]]Test brackets ([ ] and [[ ]])
[ is actually a command, so a space is required after the opening bracket and before the closing one, and also around operators such as = and -f. On US the brackets are unshifted keys right of P; on JIS they are the keys right of @ and :. Practice "[ " and " ]" as units that already include the space.
; thenKeyword separators (then / fi, do / done)
; is an unshifted key right of L on both US and JIS. if needs ; then before the body and closes with fi; for and while need ; do and close with done. Drill the whole patterns "; then", "; do", "fi" and "done" so you never stop to recall which keyword comes next.
#!/bin/bashShebang line
# is Shift+3 and ! is Shift+1 on both US and JIS, and / is unshifted near the right Shift on both. The shebang is identical at the top of almost every script, so it is one of the easiest strings to make fully automatic. Repeat it until you can type it without looking.
~/Home directory paths and flags
On US, ~ is Shift+` at the top left. On JIS, ~ is Shift+^, the key right of - in the number row. Paths are mostly lowercase letters, / and -, all unshifted on both layouts, and the same - key starts flags such as -f, -rf and --help. Keep the right pinky ready for / and the right ring or pinky finger for -.
Shell typing data on DevType
- Median speed
- 21 WPM
- Top 10% speed
- 35 WPM
- Average accuracy
- 90.7%
Most mistyped symbols
- 1.
' - 2.
; - 3.
_ - 4.
] - 5.
=
Based on Shell plays on DevType as of November 2026. Plays shorter than 5 seconds are excluded. The numbers are updated as more records come in.
Common typing mistakes in Shell
Missing spaces inside test brackets
["$name"="dev"] looks compact, but the shell sees one strange word instead of a test with arguments. You need a space after [, before ], and around the = operator. When typing fast, people tend to glue the bracket to the quote because both are near each other on the keyboard.
if ["$name"="dev"]; then # NG
if [ "$name" = "dev" ]; then # OKLeaving variables unquoted
An unquoted $dir is split on spaces and expanded as a glob, so a path containing a space can turn rm -rf into a command that touches the wrong files. Get into the habit of typing "${...}" every time. It costs a few extra shifted keystrokes, which is exactly why practicing it matters.
rm -rf $dir/build # NG
rm -rf "${dir}/build" # OKMixing up single and double quotes
Inside single quotes nothing is expanded, so '$HOME' prints the literal text. Use double quotes when you want variables to expand. On US the single quote is unshifted and the double quote is Shift on the same key; on JIS ' is Shift+7 and " is Shift+2, so the two are easy to confuse when your fingers are moving quickly.
echo '$HOME' # -> $HOME
echo "$HOME" # -> /home/userForgetting ; before then or do
When then or do is on the same line as if or for, it must be separated by ; or a newline. Without it the shell keeps reading and reports an error much later, often at done or fi, which makes the real cause hard to find.
for f in *.txt do # NG
for f in *.txt; do
echo "$f"
doneSpaces around = in assignments
In shell, name = "dev" runs a command called name with two arguments. An assignment must have no spaces around =. Programmers coming from other languages add spaces by habit, so this one has to be retrained deliberately. Note that inside [ ] the opposite rule applies and spaces around = are required.
name = "dev" # NG
name="dev" # OKGetting the order of redirections wrong
Redirections are applied from left to right. 2>&1 > out.log first sends stderr to where stdout currently points, the terminal, and only then moves stdout to the file. Write > out.log 2>&1 when you want both streams in the file.
cmd 2>&1 > out.log # stderr still on screen
cmd > out.log 2>&1 # both go to the fileTips to type Shell faster
Practice recurring patterns as chunks
Shell has a small set of fragments that show up constantly: "${, $(, 2>&1, && , | , ; then, ; do, -rf and #!/bin/bash. Typing each as one practiced motion is much faster than assembling it character by character, and it also reduces the chance of a misplaced space.
Put accuracy first
A mistyped shell command can delete or overwrite files, so accuracy has real value here. In DevType, misses lower the score significantly and an unbroken streak builds a combo, so the scoring rewards the same habit. Slow down until you can finish a snippet cleanly, then speed up.
Set your real keyboard layout
Shell symbols are where US and JIS keyboards differ most: quotes, parentheses, &, |, ~ and the brackets all move. In Settings, choose your logical layout and physical layout (ANSI, ISO or JIS) so the keyboard guide and the key accuracy analysis match the keyboard you actually use.
Use the pace caret to push speed
Once your accuracy is stable, turn on the pace caret in Settings under the play screen options. It shows a second caret moving at a target WPM, so you can see whether you are ahead or behind. Set it a little above your current speed rather than far above it.
Find and target weak keys
After a run, the AI typing analysis on the result page points out slow keys and weak fingers. In shell these are often $, |, & and the braces. Use AI-generated practice problems that focus on them, or post your own scripts as custom problems. Press Esc for a new problem and Tab+Enter to retry the same one.
Shell typing practice plan
- 1
Step 1: Levels 1-2, clean single commands
Start with short commands, assignments and simple if tests. The goal is to finish without any mistakes, with correct spaces inside brackets and no spaces around =. Retry the same problem with Tab+Enter until you can complete it cleanly several times in a row.
- 2
Step 2: Level 3, pipes and redirection
Move on to pipelines, command substitution and redirection. Aim to type |, 2>&1, $( ) and "${ }" without looking at the keyboard. If you rely on the keyboard guide, switch it from keyboard + hands to keyboard only, and then off, as you gain confidence.
- 3
Step 3: Level 4, functions and loops
Practice functions, for and while loops and case statements. Keep the accuracy you built in the earlier steps while raising your speed: turn on the pace caret and set it slightly above your recent WPM.
- 4
Step 4: Level 5, complete scripts and review
Type full scripts with error handling. Use the replay to see where you hesitated, check the AI typing analysis for weak keys, and practice with AI-generated problems or your own deployment and setup scripts posted as custom problems.
Difficulty Levels
Shell code examples
Each example has a line-by-line explanation and can be practiced right away (practice results are not recorded in the rankings).
Level 1
Level 2
Level 3
Level 4
- Argument Processing
- Arithmetic Operations
- Array Iteration
- Awk Processing
- Background Processes
- Command Substitution
- Default Values
- File Locking
- Here Document
- Here Document
- Parameter Expansion
- Parameter Expansion
- Process Substitution
- Process Substitution
- Regex Matching
- Sed Text Replace
- Signal Handling
- Temporary Files
- Test Operators
- Trap Signal Handler
Level 5
- Associative Arrays
- Backup Script
- Complete Script Template
- Config File Parsing
- Error Handling
- File Descriptors
- File Watcher
- Functions with Return
- Getopts Arguments
- HTTP Request
- Interactive Menu
- JSON Processing
- JSON Processing with jq
- Logging Function
- Named Pipes (FIFO)
- Parallel Processing
- Parallel Processing
- Pipeline Processing
- Robust Error Handling
- Secure Script Practices
Shell typing practice FAQ
Does typing practice actually help with shell scripting?
Yes. Shell relies heavily on shifted symbols and exact spacing, and much of it is typed directly in a terminal. Practicing makes patterns like "${VAR}", 2>&1 and ; then automatic, which means fewer syntax errors and less time spent fixing commands you just typed.
Should I use [ ] or [[ ]] in Bash?
[ ] is the POSIX test command and works in any sh-compatible shell. [[ ]] is a Bash keyword that handles unquoted variables more safely and supports pattern matching. In Bash scripts [[ ]] is usually more convenient; for portable scripts use [ ]. Both need spaces inside the brackets, so practice both.
Is a JIS keyboard a disadvantage for shell?
Not inherently, but symbols sit in different places. On JIS, " is Shift+2, ' is Shift+7, & is Shift+6 and the parentheses are Shift+8 and Shift+9, while : and @ have their own keys. The main risk is switching between JIS and US keyboards. Set the physical layout in DevType's settings so the keyboard guide shows your actual keys.
How is WPM calculated for shell code in DevType?
WPM is the number of valid keystrokes divided by five, per minute. Leading whitespace at the start of a line is entered automatically and is not counted, and Enter counts as one keystroke. Spaces inside a line, such as those inside [ ] or around |, are part of the code and must be typed.