I don’t like the Spotlight indexing and search that is included in Mac OS X. I use Quicksilver instead but have been procrastinating turning off Spotlight.
Well I finally got around to disabling Spotlight and wanted to go about it in a safe way. I came across too many forum posts doing dangerous things to disable Spotlight. I also wanted and easy way to remove it from the menu bar. Below are aliases I added to my bash profile to conveniently enable and disable spotlight. I am not a bash scripting master, so feedback is welcome and appreciated.
Step 1 – Add aliases
Open your bash profile (location: ~/.bash_profile ) and add these lines:
alias spotlight-off='sudo mdutil -a -i off && sudo mv /System/Library/CoreServices/Search.bundle/ /System/Library/CoreServices/SearchOff.bundle/' alias spotlight-on='sudo mdutil -a -i on && sudo mv /System/Library/CoreServices/SearchOff.bundle/ /System/Library/CoreServices/Search.bundle/'
Step 2 – Source your bash profile
source ~/.bash_profile
Step 3 – Run command
In your shell, run
$ spotlight-off
Step 4 – Restart SystemUIServer Process
$ ps aux | grep SystemUIServer.app # take note of the PID which is the first number you will see $ kill -HUP <insert PID here>
You could potentially restart your computer instead of performing Step 4, but that is inconvenient. Let me know if you have any comments or a nice way to include everything in one script. I didn’t have time to condense this process further.
If you enjoyed this post, make sure you subscribe to my RSS feed!










5 Comments
Thanks! Exactly what I was looking for, and you even made Bash aliass for me.
For your step 4, you can use ‘killall SystemUIServer’ rather than greping the pid and using kill.
My next step is to bind QuickSilver to a keyboard shortcut so I can launch it sans spotlight when it crashes. I plan to use the program titled “This Service” to add the script to the Services menu.
Below a list of interesting links that I found this week: Interaction: Test Usability By Embracing Other
Could you please tell me
1. where is location: ~/.bash_profile
I cant find it ?
2. do i include the purple word alias in the text (once i get to the file)
thank you
@wayne – create the file if you don’t have it. then activate it by typing the command “source ~/.bash_profile” and pressing enter. You do include the purple word alias. That command means “consider the command to left of the equal sign an alias for the command on the right of the equal sign.” So it essentially creates a new command that executes the script on the right by typing the command on the left.
Tony
Thanks for info
I Just opened the terminal and typed the following command (suggested in a forum)
sudo mdutil -a -i off
I then wacthed Mds and mdworker drop significantly down the list in my activity monitor
So im not too sure if i need to do what you suggest as well??
Sorry for being a novice