1

When open terminal, it always shows -bash: Searching: command not found. It does not affect other functions, just each time, even though open a new terminal window, it still pops up at the top of the window: -bash: Searching: command not found.

How to not display the -bash: Searching: command not found or stop it keep searching?

Screen as below:

Last login: Mon Feb 23 14:11:40 on ttys001

-bash: Searching: command not found
-bash: Searching: command not found

Caroline-MacBook-Air:~ Caroline$ echo $PATH
/usr/local/heroku/bin:/Users/Caroline/.rbenv/shims:/Users/Caroline/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

1 Answer 1

1

Have you edited your ~/.bash_profile, ~/.bash_login or ~/.profile files recently? When you open a new “Terminal” session it will load all three of those files in that exact order and set any variables or commands that might be set in those files. Look in each file like this; using nano in this example but feel free to use whatever plain-text editor you prefer:

nano  ~/.bash_profile

nano  ~/.bash_login

nano  ~/.profile

Note that on a typical Mac OS X system only ~/.bash_profile will actually be set; ~/.bash_login and ~/.profile are optional but worth checking just in case.

And looking at the wording of the error it looks like Bash is attempting to run a command named Searching. You can replicate this behavior by opening up a “Terminal” session, ignoring those odd errors you have and just typing:

Searching

And hit return. The error returned will be:

-bash: Searching: command not found

So I would check all three of those init files—~/.bash_profile, ~/.bash_login and ~/.profile—and see if Searching is entered as a command on any one of those lines and removing it.

Also, if you are nervous about deleting anything in those files, just comment out the lines with a # and see what happens. As long as the command is commented out, it won’t run. And if it won’t run, no more error.

2
  • 1
    Thanks Jake. Removed the searching from ~/.bash_profile. Now it does not show the error. In the .bash_profile, it shows Searching formulae... Searching taps..., removed both, now it does not show the error. Feb 24, 2015 at 3:38
  • :) Still cannot upvote, need 15 reputation. Will do later. Have check it off n accepted the answer. :) Feb 24, 2015 at 3:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .