Easily delete a long word in terminal

December 26, 2018

  • command-line

Originally posted by me on Hashrocket TIL

When you type that long feature branch name or URL but then want to delete it you have a few options, but hopefully you don’t hold your backspace/delete key until every character has been deleted. That would take too long.

I recently found a new shortcut other than the well-known ctrl-w. If you press the ESC key followed by backspace the last word will be deleted!

demo


Written by Dorian Karter, a Sr. Software Engineer
Github | Twitter

© 2021, Dorian Karter