In addition to the accepted answer, you can create an alias to easily show / hide hidden files in the terminal. Here's how I set it up (tested / works on macOS Mojave 10.14.1).
In my user directory, I created a new .custom_aliases file and wrote this in:
# Show/hide files alias showall='defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder' alias hideall='defaults write com.apple.finder AppleShowAllFiles -boolean false; killall Finder'
Then I opened .bash-profile (it should also be in your user directory, if not just creating it there) and added this to the top of the file:
# Load custom aliases source ~/.custom_aliases
And this is it! Now that I need to view hidden files, I just showall in Terminal and hideall when I hideall . You can also define aliases directly in .bash_profile , but I have some other things, so I like to keep all the aliases together in a separate file.
matronator Apr 6 '19 at 13:48 2019-04-06 13:48
source share