Search code examples
bashshellshortcutreadlinekey-bindings

How to delete a whole word after the cursor in a Bash-like command-line tool?


In command-line applications as the shell that implement -like line editing capabilities, there is a key binding for deleting a whole word before the cursor, which is by default Ctrl+W.

Is there a key binding for deleting a whole word after (to the right of) the cursor? If not, how can I achieve this?


Solution

  • Use Esc + D or Alt + D to delete the word on the right.