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. This is lesson 4 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.
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 syslogRepeating 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 updateRunning 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 502Recalling by Prefix
!prefix reruns the most recent command starting with that text - !grep repeats your last grep.
!grep # reruns the last grep commandArrow 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).
Learn DevOps Bootcamp with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 142
- Lessons
- 568
Frequently Asked Questions
Is the “Tab Completion & Command History” lesson free?
Yes — any 3 lessons of the DevOps Bootcamp learning path, including “Tab Completion & Command History”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.
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, so you can start here or from the beginning and move at your own pace. This is lesson 4 of 4.
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
- Introduction to Linux & Terminal
- Navigating the Filesystem (cd, ls, pwd)
- File Management Basics (mkdir, cp, mv, rm)
- Tab Completion & Command History