Delete until previous punctuation mark in Bash

Posted by hekevintran on Super User See other posts from Super User or by hekevintran
Published on 2010-03-29T02:50:56Z Indexed on 2010/03/29 2:53 UTC
Read the original article Hit count: 725

In Bash, Ctrl + W will erase the last word. Bash considers words to be delimited by spaces.

This means that if the cursor is at the end of the string "cd /dir1/dir2/dir3" and you hit Ctrl + W you will be left with "cd ".

Is there a Bash shortcut (custom defined is okay) that will leave me with "cd /dir1/dir2/"?

© Super User or respective owner

Related posts about bash

Related posts about command-line