Living collection · SHL-001 to SHL-026
The symbols the shell has kept since the seventies, one per page.
Event designators, word designators and the modifiers of history expansion: every relic gets its card, its label, and the answer to the question that matters — how to call it.
Drawers
The six drawers these relics are kept in.
The whole display case
- SHL-001 !! The previous line, whole, brought back — sudo !! is the classic portrait. Events common
- SHL-002 !n The command numbered n in history, called by its number. Events forgotten
- SHL-003 !-n The command n lines back, counting from the end. Events forgotten
- SHL-004 !texto The last command that started with that text. Events uncommon
- SHL-005 !?texto? The last command containing the text, anywhere in the line. Events forgotten
- SHL-006 !# The line you are typing, repeated before you press Enter. Events forgotten
- SHL-007 ^velho^novo^ Fixes the previous line by swapping old for new, then runs it. Substitution uncommon
- SHL-008 !:0 Just the name of the previous command, with no arguments. Words uncommon
- SHL-009 !:n The nth word of the previous line — the command is word zero. Words forgotten
- SHL-010 !^ The first argument of the previous line — !$'s shy sibling. Words forgotten
- SHL-011 !$ The last argument of the previous line. If you take one home, take this. Words common
- SHL-012 !:* All the arguments of the previous line, without the command. Words uncommon
- SHL-013 !:n-m A range of words, from the nth to the mth, inclusive. Words forgotten
- SHL-014 !:n* From the nth word to the last: the tail of the line. Words forgotten
- SHL-015 !:n- From the nth to the next-to-last — drops the final word. Words forgotten
- SHL-016 :h Of a path, keep the directory: dirname without a subshell. Modifiers uncommon
- SHL-017 :t Of a path, keep the file name: a two-letter basename. Modifiers uncommon
- SHL-018 :r Drops the file's extension and keeps the rest. Modifiers forgotten
- SHL-019 :e Keeps only the extension, discarding the rest. Modifiers forgotten
- SHL-020 :s/a/b/ Swaps the first occurrence of a for b before running. Modifiers forgotten
- SHL-021 :gs/a/b/ Swaps every occurrence, not just the first. Modifiers forgotten
- SHL-022 :p Prints the expansion without running it — the box's safety net. Modifiers uncommon
- SHL-023 fc Opens the previous command in your editor; saving is running. Neighboring tools forgotten
- SHL-024 ctrl-r Incremental history search — the path everybody knows. Neighboring tools common
- SHL-025 alt-. Pastes the previous line's last argument; repeated, it digs back in time. Neighboring tools uncommon
- SHL-026 set +H The switch: turns history expansion off where it gets in the way. Containment forgotten