← codetypingtest

Bash typing test

Bash scripts glue the command line together, and they're full of characters you rarely type in prose: $ before variables, (( )) for arithmetic and {1..15} to expand a range. Blocks close with unusual words: fi ends an if (it's if backwards) and done ends a loop.

Start the Bash typing test

What you'll type in Bash

Example: FizzBuzz in Bash

Each condition sits inside double parentheses with a space at each end: (( i % 15 == 0 )). Bash would accept it without those spaces, but here you type the program exactly as shown.

for i in {1..15}; do
  if (( i % 15 == 0 )); then
    echo "FizzBuzz"
  elif (( i % 3 == 0 )); then
    echo "Fizz"
  elif (( i % 5 == 0 )); then
    echo "Buzz"
  else
    echo "$i"
  fi
done

Type this program now

Tips for typing Bash faster

All 20 Bash programs

Every program is real, working Bash. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages