Last Updated: February 25, 2016
·
428
· roam

Remember the shortcuts that save time

Shortcuts save time (http://coderwall.com/p/qcb67q), but now you need to actually remember them. The quick and easy way, since you're already in terminal-land, is to add some help to your .profile or .bashrc file:

bash_help () {
    echo "Ctrl-A           Start of line"
    echo "Ctrl-E           End of line"
    echo "Alt-B            Previous word"
    echo "Alt-F            Next word"
    echo "Ctrl-X Ctrl-X    Start or end of line"
    echo "Ctrl-K           Delete rest of line"
    echo "Alt-D            Delete next word"
    echo "Ctrl-W           Delete previous word"
    echo "Ctrl-X Ctrl-E    Open command in $EDITOR"
    echo "^wrong^right^    Replace word in previous command"
}

Can't remember the correct command?

$ bash_help
Ctrl-A                  Start of line
Ctrl-E                  End of line
...