You can quit Finder using the AppleScript command tell application "Finder" to quit
. It will stay quit until you launch it again with tell application "Finder" to launch
(or tell it to activate
), or click on its Dock icon.
The AppleScript commands can be issued from the command line, using
/usr/bin/osascript -e 'tell application "Finder" to quit'
/usr/bin/osascript -e 'tell application "Finder" to activate'
From Terminal, with the normal PATH settings, you can save some typing by leaving off the /usr/bin/
part, but when writing shell scripts it's prudent to spell out all commands using full paths.
When Finder quits normally, as above, launchd will not automatically respawn it. If it quits abnormally, for example using kill
or killall
or via force quit, or if it crashes, launchd will respawn it immediately.
Most of the important work Finder did in the background has been shifted to System Events or to Dock. The split between Finder and System Events is basically that System Events has taken over manipulation of files and folders, leaving Finder to focus on just their visual appearance. When an AppleScript tells Finder to do something that is now System Events' responsibility, Finder just passes the request along, but still gets launched along the way.
But generally, the only reason to quit Finder is to manipulate something behind its back, for example in the common sequence
osascript -e 'tell application "Finder" to quit
defaults write com.apple.Finder ...
osascript -e 'tell application "Finder" to launch
or because you've just gone into System Preferences→Language & Region to change your language defaults and want Finder to start using the new settings.
I can't think of a reason to make Finder stay quit. If you're worried about visual clutter, just hide it. If you're worried about CPU usage, it doesn't use any while it's hidden (except to respond to Apple Events), and not much while it's not. Time-consuming tasks like copying files or emptying the trash get passed off to the background process racoon
.
If you're worried about its RAM usage, it doesn't use much (under 45MB on my system), and since Mavericks it supports Sudden Termination. If the system sees it's not doing anything (because it's hidden, for example) and has a use for the RAM (for example, to delay having to start swapping to disk), it'll silently quit it without telling you. The Dock will continue to show it as running, but Activity Monitor will show that it actually isn't.
defaults write com.apple.finder QuitMenuItem -bool YES