Filed under: Terminal Tips
Terminal Tips: Disable Spotlight in menu bar
Are you tired of accidentally opening spotlight by pressing command + space? With this simple Terminal "hack," you can rid your precious menu bar of Spotlight for once and all. Just open Terminal.app (located in /Applications/Utilities/) and type the following command: sudo chmod 0 /System/Library/CoreServices/Spotlight.appYou will be required to authenticate as an administrator, then the command will run. While you are still in the Terminal, type "killall Spotlight" to turn off the spotlight service right then. Spotlight will suddenly dissappear from your menu bar. To get Spotlight back, just type the following command back into Terminal:
sudo chmod 775 /System/Library/CoreServices/Spotlight.appAfter a few seconds, Spotlight will reappear in your menu bar. Note that this does not remove Spotlight from Finder windows, only from the menu bar.
Want more tips and tricks like this? Visit TUAW's Mac 101 and Terminal Tips sections.

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 2)
Joshua Ochs said 10:15AM on 9-23-2008
Tired of Command-Space opening Spotlight? Then just change the key command (or disabling it) in System Preferences -> Keyboard & Mouse -> Keyboard Shortcuts.
TUAW, leave the tips for Mac OS X Hints.
Reply
Think Adrian said 10:20AM on 9-23-2008
Agreed.
Big John said 10:46AM on 9-23-2008
How does that accomplish what the tip accomplishes? All that does is change (or disable) the *keyboard shortcut*. That doesn't remove the little magnifying glass from the menu bar.
Nafai said 10:58AM on 9-23-2008
Big John, the thrust of this post is that some people accidentally click cmd+space, not accidentally move their mouse to the top right corner of the screen and click the little magnifying glass. The solution is incorrect and horrible for the described problem.
utterer said 1:19PM on 9-23-2008
Joshua hittin' with the PROTIP.
nafai said 10:54AM on 9-23-2008
Seriously, setting an application in CoreServices to unreadable, unwritable, unexecutable permissions to accomplish something available in the System Preferences? This is a terrible, terrible idea, and is asking for problems.
Reply
ThreeBKK said 5:56AM on 9-24-2008
+1
Setting permissions so that any and all users, including the system, can't access the Spotlight application, doesn't sound like solid methodology for "modding" the Menu Bar.
One might even classify this tip as being "reckless", but I'm not an expert.
Experts: Please chime in!
Yorgle said 10:46AM on 9-23-2008
This does nothing for the Spotlight indexing, which is still running in the background... and is the actual part that is resource intensive.
Also, the above only works in 10.5 For 10.4, to accomplish the same thing (no Spotlight in the menu bar) you need to move aside /System/Library/CoreServices/Search.bundle and some more bits to keep it from restarting (and keep it from dumping errors to the log)
Again, this does not turn off indexing.
Reply
Dylan Unutmaz said 10:47AM on 9-23-2008
I just tried this but it just disappeared for a second after i did killall then came right back. No matter what I do i can't keep spotlight off my computer. I've followed these steps -
"
So: This is how to disable Spotlight completely in 10.5:
0) Start Terminal and enter the following commands
1) stop and disable the spotlight application itself:
cd /System/Library/LaunchAgents
launchctl unload com.apple.Spotlight.plist
sudo launchctl unload -w com.apple.Spotlight.plist
Just ignore the errormessage from the last command.
The first command stops the application for the current user. The second command disables for every user. The reason you get the error is that you are effectively executing the command as root, but the root user hasn't any running instance of Spotlight. On the other hand, only the root user is able to disable the automatic start of Spotlight. Thus the need for the sudo command.
2) stop and disable the background server:
cd /System/Library/LaunchDaemons
sudo launchctl unload -w com.apple.metadata.mds.plist
3) remove the .Spotlight-V100 directories
sudo find / -iname '.Spotlight-V100' -type d -maxdepth 3 -print0
| xargs -0 -t -n1 sudo rm -rf
"
That held it off until a reboot which the spotlight menu item came right back up and the mds process came right back up. Does anyone have a permanent method?
Reply
Big John said 10:47AM on 9-23-2008
Well, Cory, you finally did it.
A Terminal Tip I won't use ;)
I agree with the general sentiment that chmod is something that should be shied from (one typo can cause major issues).
I don't know the structure of OS X very well, but wouldn't this also completely disable Spotlight?
Reply
Jenn said 11:26AM on 9-23-2008
Using this tip is not a good idea if you don't know what you are doing. I'd found this hack on another website and like an idiot decided to run it. A few days later, my Macbook crashed. The Apple Store had to replace the hard drive completely. Thankfully I'd just bought AppleCare and my warranty covered it.
Reply
AdamC said 12:07PM on 9-23-2008
Jenn, I completely agree that running a command of this sort is quite risky and can potentially cause many problems, but I doubt that disabling an application crashed you hard drive to the point of needing to be completely replaced. There's nothing this could hurt that a simple reinstall wouldn't fix.
Reply
Ian Eure said 12:34PM on 9-23-2008
This tip is extremely problematic. Having used it before, it does work, but has at least one serious side-effect. Namely, launchd will continuously try to spawn the Spotlight process in the background every few seconds. This will spam your logfiles with many megabytes of messages, as well as put a drain on your system - a small drain, perhaps, but an unnecessary load nonetheless. It’s also highly likely that if you repair permissions, it will come back.
Dylan’s tip is much better, though I don’t know if that will prevent the launch of the service when you reboot. I hacked my launchd plist file and marked the Spotlight service as disabled.
The steps are detailed at my blog: http://atomized.org/2008/05/the-correct-way-to-disable-spotlight/
Reply
leenyx said 12:46PM on 9-23-2008
Why would anyone uninstall one of the best applications implemented in the mac OS. In Leopard Spotlight works wonderfully, I bet the same guy is installing Quicksilver because someone has told him that's the way to go, when Spotlight is so useful and easy to use...
Nevermind I am starting to think that too many PC guys are switching and starting to mess up with everything...
Reply
Brendan said 1:05PM on 9-23-2008
If you want to kill spotlight completely, just go to terminal and type:
sudo defaults write /System/Library/LauchAgents/com.apple.spotlight KeepAlive false
You will have to enter your Administrative password.
Then you can kill the process with Activity Viewer. The above command prevents OS X from re-starting Spotlight when it detects it has quit.
To reverse, just type true instead of false.
Reply
Mike said 1:05PM on 9-23-2008
That is a lot of dangerous work for something that can be done with one mouse click in the peference pane for Spotlight. All the way at the bottom it says: "Spotlight menu keyboard shortcut." Just uncheck it and you are done.
Reply
yakov chodosh said 2:27PM on 9-23-2008
What about just adding Macintosh HD to the list of Spotlight exceptions?
p.s. you are all insane, trying to disable one of the MAIN reasons to use Mac OS X
Reply
Mike Schau said 2:56PM on 9-23-2008
Ugh hate to have to keep scrollign past the ugh ugh Obama plug to read your fine site.
Not all Mac users are liberal Democraps.
Reply
Pradador said 9:37PM on 9-23-2008
Leave Spotlight alone!!!
Reply
Luigi193 said 6:48PM on 9-23-2008
This is probably the worst tip ever published.
Go to the spotlight preferences and change it their!
If you don't want the indexing, set your entire HDD to private, and it will IMMEDIATELY stop all indexing forever(on that drive of course)...
This could be dangerous around system update time...
PLUS it would most likely be reset, when permissions are repaired...
Reply