Utilities for macOS

Ruijun Gao @ Apr 23, 2022

This article is a collection of utilities for macOS that may solve some tricky problems.

Restart the Touch Bar

You can enter and execute the following command to restart the touch bar, which will resolve a blank touch bar or other tricky issues with the touch bar.

sudo pkill TouchBarServer

Fix 3 and 4 Finger Gestures

When 3 and 4 finger gestures randomly stop working on your MacBook, you can try enter and execute the following command to fix them. After a short screen blink, gestures should work again.

sudo pkill Dock

Remove Dot-Underscore Files

The following command will recursively delete all dot-underscore files (with names like ._*) in the current working directory. This is useful when accessing removable drives, as macOS automatically creates some annoying and useless dot-underscore files.

dot_clean .

Remove .DS_Store files

Similar to "Remove Dot-Underscore Files" above, this will delete the .DS_Store files included in the current folder.

sudo find . -name ".DS_Store" -depth -exec rm -f {} \;