0Pricing
DevOps Bootcamp · Lesson

Tab Completion & Command History

Work faster in the shell. Learn tab completion to auto-finish paths and commands, and history to recall, search, and re-run previous commands.

Tab Completion & Command History is a free DevOps Bootcamp lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Working Faster in the Shell

Typing every command in full is slow and error-prone. The shell hands you two big productivity wins: Tab completion and command history.

Tab Completion Basics

Start typing a command or filename and press Tab - the shell finishes it for you when there's only one match, as shown.

cd Doc<Tab>   # becomes: cd Documents/

Multiple Matches

When several names match, the first Tab does nothing. Press Tab twice to list all candidates, then type one more letter to disambiguate.

ls Down<Tab><Tab>
Downloads/  Downstream/

Completing Commands

Tab completes command names too, not just files. Type a prefix and double-Tab to see every command that starts with it.

gi<Tab><Tab>
git  gitk  ...

Viewing History

The history command prints your recently run commands, each with a number you can reuse - as shown below.

history
  501  cd /var/log
  502  ls -l
  503  grep error syslog

Repeating with !!

!! reruns your last command. It's perfect with sudo when you forgot it: sudo !! re-runs the previous line as root.

apt update        # permission denied
sudo !!           # runs: sudo apt update

Running by Number

Run any past command by its number with !n - for example !502 reruns command 502 from your history.

!502   # reruns the command numbered 502

Recalling by Prefix

!prefix reruns the most recent command starting with that text - !grep repeats your last grep.

!grep   # reruns the last grep command

Arrow Keys

Press the Up and Down arrows to step through previous commands one by one, then edit and Enter to run.

Searching History

Press Ctrl+R for reverse search: start typing and the shell finds the latest matching command; press Ctrl+R again to go further back.

(reverse-i-search): tar
tar -czf backup.tgz logs/

Where History Lives

History persists across sessions in a file (often ~/.bash_history). The HISTSIZE variable sets how many commands are kept.

Quick Check

Test your shell skills.

Recap

Recap: work faster with Tab completion (auto-finish, double-Tab to list) and history (history, !!, !n, !prefix, arrows, Ctrl+R).

Frequently asked questions

Is the “Tab Completion & Command History” lesson free?

Yes — the full text of “Tab Completion & Command History” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.

What will I learn in “Tab Completion & Command History”?

Work faster in the shell. Learn tab completion to auto-finish paths and commands, and history to recall, search, and re-run previous commands. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Tab Completion & Command History” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Introduction to Linux & Terminal
  2. Navigating the Filesystem (cd, ls, pwd)
  3. File Management Basics (mkdir, cp, mv, rm)
  4. Tab Completion & Command History
← Back to DevOps Bootcamp