[kwlug-disc] Weird but handy shell tricks
William Park
opengeometry at yahoo.ca
Tue Mar 31 11:42:49 EDT 2026
On 2026-03-29 23:28, D. Hugh Redelmeier wrote:
>> From: CrankyOldBugger <crankyoldbugger at gmail.com>
>
>> Not sure who could benefit from this, but here's a site with some useful
>> shell tricks:
>>
>> https://blog.hofstede.it/shell-tricks-that-actually-make-life-easier-and-save-your-sanity/
>
> Yes, they are useful.
>
> Most are natural to an EMACS user (like me).
>
> Apparently "set -o vi" adjusts readline to respond to key sequences more
> familiar to vi users.
I switched to Vi-mode long ago. You can type "set -o vi" directly on
command line or from login scripts. Actually, Bash's command line
processing is handled by "readline" library, which reads ~/.inputrc.
So, you can use that for anything using "readline".
Even though I'm a Vi guy, there are 2 Emacs-style line editing that I
use a lot: (in ~/.inputrc)
C-f: unix-filename-rubout
C-e: yank-last-arg
where
"unix-filename-rubout" -- deletes back to the last '/' char.
"yank-last-arg" -- pastes the last arg from previous lines.
"C-f" and "C-e" are my key assignments. You can assign to any keys.
More information about the kwlug-disc
mailing list