4 ms·
cat foo | less Normally I'd typed something like "grep -i 'something' foo | less", and wanted to just up arrow the previous line and change the grep stuff to c
by bitwize 14y ago
cat foo | less
Normally I'd typed something like "grep -i 'something' foo | less", and wanted to just up arrow the previous line and change the grep stuff to cat. I don't know why, it doesn't really save me anything. Maybe it's the hackerish "because I can, that's why" instinct at work.
- jaylevitt 14y agoIt'll save you a few more keystrokes if you do cat !$ | less !$ is "the last argument to the previous command".
- mrud 14y agoIf you do less <ESC>. it will save you even more keystrokes.
- voltagex_ 14y agoDo you remap ESC to another key?
- mrud 14y agoNo, but for me <ESC> acts like <META> and the actual keybinding is M-. or M-_. The command you are looking for is yank-last-arg for bash and insert-last-word for zsh.
- graywh 14y agoYou have that backwards--Meta actually means "prepend Escape" (or 8th bit on, but that's another discussion).
- 16s 14y ago`cat foo | less` is gratuitous. `less foo` is all you need.