Bash tricks by Julia Evans
@cypnk if you like Vim (who doesn't?) You can get all of the Vi hotkeys with this command:
set -o vi
Put it at the end of your .bashrc file for super convenience!
@vector This is why I nano ;)
Most of these aren't exclusive to bash; other Bourne-like shells like ksh support these, too.
Instead of Ctrl-R I use the fc built-in for history. It works in both bash & ksh. Using fc -l lists the history, fc -s [number] executes the command again and just fc [number] lets you edit the command with the editor defined in the EDITOR environment variable, or /bin/ed if it's not defined.
Where can I get the source?
Super useful. Thanks for sharing.
Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!