Take the 2-minute tour ×
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.

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
add comment

2 Answers

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
add comment

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
echo "$GREP_OPTIONS"

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
add comment

Your Answer

 
discard

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.