Today I was working with one of my web projects. I wanted to transfer files from one location to another one. It looks very easy & simple. The next thing which I did – I started Nginx server and opened my project in browser. I was surprised, when I received an error from Phalcon (this is a PHP framework) framework, that URL rewriting should be turned on. I realized that I forgot to transfer “.htaccess” file, because this file is not visible in Mac OS system by default. Tutorial was made with MacOS High Sierra 10.13.2.
How to show hidden files on macOS?
- Open “Terminal”. You could find it using Spotlight or go to Finger > Applications > Terminal.
- Execute command: [code]defaults write com.apple.finder AppleShowAllFiles YES[/code]
- Then you should relaunch “Finder”. Execute command: [code]killall Finder /System/Library/CoreServices/Finder.app[/code]
If you want to hide files again – then execute same all steps again and in step 2 change parameter from “YES” to “NO”.
How to make Terminal shortcuts to show/hide files?
- Execute command in Terminal: [code]nano ~/.bash_profile[/code]
- Paste the following lines at the end of file: [code]alias showFiles=’defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app’
alias hideFiles=’defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'[/code]
- Hit Ctrl+X, then type “Y” and hit Enter to save changes.
- Then we should refresh our aliases. We should execute command in terminal: [code]source ~/.bash_profile[/code]