printf '''\nalias showfiles="\ndefaults write com.apple.finder AppleShowAllFiles YES\nkillall -KILL Finder"\n''' >> ~/.bash_profile && printf '''alias hidefiles="\ndefaults write com.apple.finder AppleShowAllFiles NO\nkillall -KILL Finder"\n''' >> ~/.bash_profile && source ~/.bash_profile
Now you can easily hidefiles
and showfiles
for hidden .gitconfig
for instance