Using Ctrl or Alt AND backspace to delete last word in Bash

You can always use Ctrl-W. It deletes the word before the cursor and works in every Bash.

See here for a list of Bash keyboard shortcuts.


You just need to set Option as Meta key in iTerm's preferences (Profiles » Keys).

backward-kill-word is bound to Meta-Rubout (i.e. Opt-Backspace) by default.

The same option exists (albeit less flexible) in Apple's Terminal.app.


You can create a file .inputrc in your home directory and add this content inside:

"\C-h": backward-kill-word