Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

When I use tab-completion in zsh, the shell suggests me files and I discover that I'm in the wrong directory. How can I just delete the suggestion instead of backspace'ing it?

share|improve this question

migrated from serverfault.com Nov 21 '11 at 0:12

This question came from our site for system and network administrators.

You can use the undo command (C-_ or C-x u) to cancel the effect of the last completion.

You can then press C-q or M-q to “suspend” the current command, enter cd correct-directory and resume your editing of that suspended command.

share|improve this answer
Thanks Gilles. Hmm they all do not work, but I guess that is because I'm using iTerm on Mac, and the key combinations are actually triggering iTerm. For example, M-q quits iTerm :-/ – Daniel Nov 18 '11 at 22:24

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.