0

Since I'm not really great with using the terminal, I would like to see hidden folders on my Mac through the regular user interface. However, I cannot show my hidden folders. I tried things I found on the internet but they did not work for me. I tried

  1. cmd+shift+dot - nothing happens

  2. settings > Keyboard > turning on and off "Use F1, F2, etc. keys as standard function keys"

  3. settings > Keyboard > Shortcuts > Restore Defaults

  4. terminal.app > defaults write com.apple.finder AppleShowAllFiles ["yes"/"YES"/" "] source

  5. at the folder I want to view the hidden contents of, I pressed Alt while clicking Go. after the "Library" folder showed up in "Go," I clicked it and saw many folders in Library, but still didn't see any folders with . in front. source

My main goal is to copy and paste into a .gitignore file that is stored in a specific folder on my desktop. I am having troubles doing it through the terminal so I thought this would be easier but it is apparently not. :)

Question: How can I fix this issue and allow myself to see hidden folders on my Mac?

I don't have a strong background in this stuff and am not trained in computer science/tech stuff.

I have macOS Mojave.

anki
  • 11,753
Ev C
  • 3

1 Answers1

0

There are two types of hidden items (files or folders) on macOS:

  • Those which start with . whose hidden bit it set by default.
  • Those with no starting ., but chflags set to hidden. Run man chflags to see more info.

I clicked it and saw many folders in Library, but still didn't see any folders with . in front

Those folders are of the second type.

However, I cannot show my hidden folders.

Let's see if there's a problem with hidden files itself. In Terminal, run :

cd ~/Downloads
mkdir test_hidden && cd test_hidden
touch empty
touch .empty_h
open .

In this folder that opens, do you see files (dis)appearing if you toggle command+shift+. ?

Update: Restarting and running killall Finder helped.

For the .gitignore file, use ls -a command to list all items in a directory. If there is a .gitignore file there, you can run

open .gitgignore

to open it with default text editor. Or nano .gitignore. Or specify a text editor:

anki
  • 11,753
  • Cmd+shift+. didn't work but one odd thing that happened is the empty file I created ended up outside of test_hidden even though I ran mkdir first. Is it supposed to do that? – Ev C Jul 22 '20 at 16:51
  • This is helpful, a workaround for this that worked for me is open -a TextEdit .gitignore. Thank you. But I wonder why my Mac will not show hidden files.. very strange – Ev C Jul 22 '20 at 16:53
  • @EvC oops.. I didn't mention a cd command. edited the answer. – anki Jul 22 '20 at 18:55
  • Do you see any improvement after running killall Finder ? this relaunches Finder. Or a restart? – anki Jul 22 '20 at 18:59
  • 1
    somehow this fixed it! Yes! I can now view my hidden files! They do not toggle when I try cmd+shift+. but this works for some reason! Thank you! – Ev C Jul 22 '20 at 19:35