← Back to context

Comment by alzee

14 days ago

> most of the examples OP gave are usually available as short options

Yes, but a lot of commands behave differently for -h and --help.

> aliasing ,s to sudo is certainly possible

Sure, but my ,s key sequence doesn’t just expand to sudo. It actually moves the cursor to the start of the current line, prefixes the command with sudo, and then moves the cursor to the end of the line. The idea is when you type a command which requires root privileges but forget to use sudo, you can just hit ctrl+p ,s to fetch the previous command and prefix it with sudo. This is what it looks like in ~/.inputrc: ",s":"^Asudo ^E"