Show hidden files files in Finder except .DS_Store I configured my Mac to show hidden files by setting AppleShowAllFiles to true running this bash command:

defaults write com.apple.Finder AppleShowAllFiles -bool YES; killall -HUP Finder


That solved my previous problem. However, there's a file that does not matter to me and I want it to be hidden again, .DS_Store.

I still want to see the other hidden files, except .DS_Store. Is there a way?

I am using OS X 10.11.
One way to achieve your desired results is to upgrade to Sierra.

macOS 10.12 shows all hidden files via your command
defaults write com.apple.Finder AppleShowAllFiles -bool YES
 – but Finder has been taught a 'new trick': it will never show you .DS_Store files regardless of your wishes or instructions.

This has the side effect that your Trash will be almost always be displayed as full, even when it is 'empty' as per Finder inspection. Because the .DS_Store file for Trash will trigger the 'full' Trash icon.