Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

I have zsh and oh-my-zsh with default values and can't figure out how to turn off autocorrection for specific commands, that I often use, such as: sudo mc or sudo gem update. The thing is that I have .mc directory and .gem directory and zsh proposes autocorrections (zsh: correct 'mc' to '.mc' [nyae]).

Generally I would like to config zsh so that sudo [smth] is not considered a separate command (which it is not) for autocorrection. What would be a fix for that?

share|improve this question
up vote 18 down vote accepted

Add this to your ~/.zshrc

alias sudo='nocorrect sudo'
share|improve this answer
That was simple! :) – Alexei Danchenkov May 1 '12 at 16:06
this should be a standard setting in zsh – apparat Aug 16 '12 at 19:09

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.