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

For some reason a while back, the behavior of my command line changed, and I don't know why. Using OSX, now Mountain Lion(although this behavior was present before the switch).

Using standard terminal, I would expect back some results from ps, but I get an error:

$ ps aux |grep 'asdf'
grep: asdf: No such file or director

This also shows up, for example, here:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
ln: /Users/peter/bin/subl: No such file or directory
share|improve this question
up vote 3 down vote accepted
  1. Does it happens when you login as another user?
  2. Check output of "set ; env; alias". Post it you can't find a problem.
share|improve this answer
bingo, that did it! I had this line in my bash_profile: alias grep='grep –colour=auto' – Peter Ehrlich Oct 16 '12 at 4:32
Close. grep --color=auto is a good alias.. One I use in fact. – Alex Leach Oct 17 '12 at 1:07

You have something that's adding a bad option under the hood (or more precisely, something that isn't an option). It could be an alias for grep (or more rarely, a function or wrapper script), or the GREP_OPTIONS environment variable. Run the following commands:

type grep

If grep is a wrapper script, fix that. If grep is an alias or function, fix it; it's probably defined in ~/.profile, ~/.bash_profile, ~/.bashrc or /etc/profile. Same thing if GREP_OPTIONS is the culprit.

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.