3 ms·
What if you need to run a third version of the command, or a version that involves deletions, e.g. "less /really/long/path/to/..."? bash-3.2$ less /var/log/a
by waterhouse 10y ago
What if you need to run a third version of the command, or a version that involves deletions, e.g. "less /really/long/path/to/..."?
bash-3.2$ less /var/log/authd.log.0.gz
"/var/log/authd.log.0.gz" may be a binary file. See it anyway?
bash-3.2$
I type: control-P control-A meta-D zcat control-E | SPACE less
bash-3.2$ zcat /var/log/authd.log.0.gz | less
On the OS X terminal, you have to configure it to treat option as meta before the meta-D above will work. I forget whether common Linux terminals require such configuration. (Edit: zless would work just as well here, and on Linux "less" appears to basically have the functionality of zless.)
- mwpmaybe 10y agoWith set -o vi: <ESC> k cw zcat <ESC> A <SPACE> | <SPACE> less <CR> Very natural for any Vi user: go up a "line", change the first word, then append.