Close ad

Users of the macOS operating system are divided into two groups. The first of them does not use the lower Dock on the Mac at all, as it prefers to reach for Spotlight, which it uses to find what it needs. The second group, on the other hand, does not allow the Dock to be used and continues to use it to quickly launch applications, or to open various folders or files. However, it has certainly happened to users of the Dock that they have inadvertently enlarged or reduced it, or moved icons inside it. Did you know that within macOS, you can lock the size, position, and contents of the Dock with a few Terminal commands? If you are interested in how to do it, be sure to read this article to the end.

How to Lock Dock Size, Position, and Contents on Mac

As I mentioned in the introduction, all these restrictions can be achieved by using the appropriate commands in the Terminal. You can get to the Terminal application easily, for example through Spotlight (icon magnifying glass in the upper bar, or a shortcut Command + Spacebar). Here, just type in the search field Terminal and application start. Otherwise you can find it in applications, and in the folder Utilities. After starting, a small black window will appear in which you can write commands.

Dock size lock

If you want to make it impossible to change with the mouse size Doc, you are copy it this command:

defaults write com.apple.Dock size-immutable -bool yes; killall Dock

And then paste it into the application window Terminal. Now just press the button Enter, which executes the command. Don't forget to resize the Dock to your liking before confirming the command.

terminal dock modification

Dock position lock

If you want it fixed position of your Dock – ie. left, bottom, or right, and so that it is not possible to change this preset, you copy it this command:

defaults write com.apple.Dock position-immutable -bool yes; killall Dock

Then paste it back into the application window Terminal and confirm the command with the key Enter.

terminal dock modification

Lock Dock content

From time to time, it may happen that you accidentally mix up certain application icons, folders, or files inside the dock. This is perfectly normal when working quickly. So if you don't want to worry about icon alignment and want it to be Dock contents lockedAnd a copy it this command:

defaults write com.apple.Dock contents-immutable -bool yes; killall Dock

And put it in the window Terminal. Then confirm it with the button Enter and it is done.

terminal dock modification

Bringing it back

If you would like to allow changing the size, position, or contents of the Dock again, just change the bool variables from yes to no in the commands. So, in the final, the commands to deactivate the lock will look like this:

defaults write com.apple.Dock size-immutable -bool no; killall Dock
defaults write com.apple.Dock position-immutable -bool no; killall Dock
defaults write com.apple.Dock contents-immutable -bool no; killall Dock
.