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

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.

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