Bash – How to delete a word next of last slash

bashkeyboard shortcutsline-editor

I have the following path :

$ vim /path/to/some/where

If I press Ctrl + w, It removes entire text to first space. The result would be :

$ vim 

How do I delete just the word next of last slash with comination keys?

Best Answer

Try Alt + Backspace.

From bash documentation:

backward-kill-word (M-DEL)

Kill the word behind point. Word boundaries are the same as backward-word.

Related Question