---
title: "禁用spotlight"
author: "andyao"
date: "2009-02-14T00:35:10Z"
tags: ["Apple"]
categories: ["操作系统"]
slug: "spotlight"
draft: false
lastmod: "2009-02-15T17:26:53Z"
id: 332607
url: "https://andyao.iteye.com/blog/332607"
---

Leopard上的spotlight纯属鸡肋，很少使用，而且还影响系统速度，不如直接禁用：
**1. 停止spotlight程序**

```shell

# 停止当前用户
launchctl unload /System/Library/LaunchAgents/com.apple.Spotlight.plist
# 停止所有用户
sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.Spotlight.plist

```

**2. 停止background server**

```shell

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

```

**3. 删除index文件**

```shell

sudo find / -iname '.Spotlight-V100' -type d -maxdepth 3 -print0 
| xargs -0 -t -n1 sudo rm -rf

```

**4. 恢复方法, 以后想恢复了再load回来**

```shell

sudo launchctl load -w /System/Library/LaunchAgents/com.apple.Spotlight.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

```