killall Dock does, and when to use itShort answer: it force-quits the Dock, and macOS immediately starts a fresh copy.
Nothing is deleted and nothing is reset. Your apps, windows and files are untouched.
killall Dock
Paste that into Terminal and press Return. The Dock disappears for about a second and comes back. There is no confirmation and no output, which is normal: killall prints nothing when it works.
killall is a Unix command that finds every running process with a given name and tells it to stop. Dock is the process name, with a capital D, because macOS runs the Dock as an ordinary background application rather than as part of the system itself.
The Dock is looked after by launchd, which is told to keep it alive. So the moment you kill it, launchd starts it again. That is the whole trick. There is no "restart the Dock" command in macOS, so you kill it and let the system put it back.
The new Dock reads its settings fresh as it launches, which is why this command appears at the end of nearly every Dock tutorial. Changing a setting with defaults write only changes the stored value. The running Dock does not notice until it restarts.
Yes, and it is the normal way to apply Dock changes. It deletes nothing, touches no files, and closes no apps. Full-screen apps and your Mission Control spaces stay as they were.
The only visible side effect is small: an app that is bouncing or showing a badge stops for the second the Dock is away, and if your Dock is set to hide, it comes back hidden.
defaults write com.apple.dock command. Without it, your change sits in the preference file doing nothing.This is where people get caught out. killall Dock does not reset the Dock. It restarts it with exactly the settings it already had. If your Dock is the wrong size or holds the wrong apps, restarting it changes nothing at all.
Resetting is a different command, and unlike this one it does throw work away:
defaults delete com.apple.dock; killall Dock
That deletes the entire Dock preference file and then restarts the Dock, which brings it back at factory settings. Every app you have pinned is gone, along with your size, position and hide setting, and none of it can be recovered. The killall on the end is only there to make the deletion take effect. Read how to reset the Mac Dock before you run it.
If you would rather avoid Terminal, Activity Monitor does the same job. Open it, search for Dock, select it, click the stop button in the toolbar and choose Quit. launchd restarts it exactly as before.
Logging out and back in also restarts the Dock, along with everything else, which is why it is the slow way to the same result.
Running Dock commands often? Our Dock lock command generator builds them for you and puts the killall Dock on the end, so it never gets forgotten.
Running these commands repeatedly? How to lock the Dock on a Mac, three ways compared.
No. It stops the Dock process and macOS starts a new one straight away. Settings, pinned apps and files are all untouched. The command that does delete things is defaults delete com.apple.dock.
Because killall matches the process name exactly, and the process is called Dock. Typing killall dock returns "No matching processes belonging to you were found" and does nothing.
No. The Dock is a separate process from everything it displays. Your apps keep running and your windows stay where they are.
No. The Dock runs as you, so you can quit it without elevated permissions. A guide telling you to use sudo killall Dock is aiming at another user's Dock, which is not what you want.
Rare, and usually it is just slow. If it really is gone, run open -a Dock, or log out and back in. A restart always brings it back, because launchd starts it as part of your login session.
Most people run killall Dock because a Dock setting keeps getting undone. Still Dock locks your Mac's Dock: size, position, contents and hide setting all hold, and applies changes without Terminal.
Using more than one screen? The Dock also jumps between them, which is a separate problem with its own fixes: how to keep the Mac Dock on one screen.
If the Dock is not just misbehaving but missing entirely, work through my Mac’s Dock disappeared instead.