How to show hidden files on macOS High Sierra?

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?

  1. Open “Terminal”. You could find it using Spotlight or go to Finger > Applications > Terminal.
  2. Execute command: [code]defaults write AppleShowAllFiles YES[/code]
  3. Then you should relaunch “Finder”. Execute command: [code]killall Finder /System/Library/CoreServices/[/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?

      1. Execute command in Terminal: [code]nano ~/.bash_profile[/code]
      2. Paste the following lines at the end of file: [code]alias showFiles=’defaults write AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/’
        alias hideFiles=’defaults write AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/'[/code]
      3. Hit Ctrl+X, then type “Y” and hit Enter to save changes.
      4. Then we should refresh our aliases. We should execute command in terminal: [code]source ~/.bash_profile[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *