Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For instance, when I type a path in terminal

cd project/example/one

I can press Ctrl+W and remove the entire "word" project/example/one. Sometimes it's not very useful.

Are there any shortcuts for removing only one word to make like following?

cd project/example/
share|improve this question
up vote 5 down vote accepted

In shells with GNU readline you could combine the backward-word (Move backward a word, Meta-b) and kill-line (Kill the text from the current cursor position to the end of the line, Ctrl-K) commands.

There's also backward-kill-word, by default on Meta-Backspace.

To get commands in zsh to use the same word boundaries (it doesn't use GNU readline), I had to set select-word-style bash.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.