Mac OSX Command: launchctl

命令: launchctl
这个命令用于控制OS X系统里的启动进程(launchd)的.
如果你需要实时控制launchd启动的服务的时候,可以使用这个命令控制

比如,如果你需要停止Spotlight服务,可以运行下面的命令:
  launchctl unload /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
停止之后又要启动该服务,那么:
  launchctl load /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

launchd是在OS X启动的时候又系统启动的,它根据自己的控制文件来启动相应的服务程序,而一般来说它的控制文件是:
$HOME/.launchd.conf 或者 /etc/launchd.conf

*****************************************
launchctl
Description:  Interface with launchd
     launchctl interfaces with launchd to load, unload daemons/agents and gen-
     erally control launchd.  launchctl supports taking subcommands on the
     command line, interactively or even redirected from standard input.
     These commands can be stored in $HOME/.launchd.conf or /etc/launchd.conf
     to be read at the time launchd starts.
SYNOPSIS
     launchctl [subcommand [arguments ...]]
:
   load [wF] paths...
:
   unload [-w] paths...
:
   start joblabels ...
:
   stop joblabels ...
:
   list

Example:
: launch spotlight daemon
  launchctl load /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
: unload spotlight daemon
  launchctl unload /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
原文链接: http://blog.csdn.net/afatgoat/article/details/3181439

你可能感兴趣的:(Mac OSX Command: launchctl)