Context
You have been working on rhel-prod-01 for the past hour running commands from Labs 1–4. Your shell history is full of real commands. This lab teaches you to work with that history — and to never type the same long path twice when the shell can do it for you.
Objectives
| # | Objective |
| 1 | Search and replay history with history, !N, !!, and !string |
| 2 | Reuse arguments with !$ (last arg) and !^ (first arg) |
| 3 | Generate lists instantly with brace expansion {a,b} and {1..5} |
| 4 | Embed command output into another command with $() |
| 5 | Define, use, and persist aliases in ~/.bashrc |
| 6 | Knowledge check |
Shortcuts Reference
| Shortcut | What it does |
| history | Show numbered command history |
| !N | Re-run command number N from history |
| !! | Re-run the last command |
| !string | Re-run the most recent command starting with string |
| !$ | Last argument of the previous command |
| !^ | First argument of the previous command |
| {a,b,c} | Brace expansion — generates a, b, c |
| {1..5} | Sequence expansion — generates 1 2 3 4 5 |
| $(command) | Command substitution — output replaces the $(...) |
| alias name='cmd' | Define a shorthand command |
These shortcuts work in bash on every Linux system. They require no extra tools — just the shell you already have.
Tab to complete · ↑↓ for history · Type ? for help