-1

How can I reveal an individual hidden folder, as opposed to showing all hidden folders and files? I'm trying to move folders and files around, but I cannot see one of the folders or it's files in finder.

Description

I'm migrating posts from WordPress to Jekyll. My exporter created markdown files in a hidden folder, unexpectedly. I am trying to move the markdown files from the hidden folder to a Jekyll site I've previously setup. In Terminal, I have created a copy of the markdown files in the correct directory. However, because the exporter generated folder was hidden, all of the contents have remained hidden. I cannot see the files in Finder and Jekyll cannot render the files correctly when I try to start the server.

Update 1: I have created an issue on the github page for the exporter, but I haven't gotten a response yet. I have tried some of the solutions below, including using Finder> Go to folder... and chflags -R nohidden ~/jekyll-site. Due to the Go to folder..., I am now able to see the folders created by the exporter. However, the folders still appear empty in Finder. chflags hasn't helped.

Update 2: I ran ls ~/jekyll-sites/subdir | wc -l, as suggested below. I got "11". Meanwhile, I thought that if I just started the server that would help. It kind of did: my posts are showing up correctly on the blog, which is an improvement, but I still don't actually see them in Finder. I've tried opening the posts in Sublime and trying a Save As. When I do, I can see them all listed in the dialog but they are all greyed out. What's more, I get an alert "A file with this name already exists".

Update 3
Tried a solution to create copy of the files, without the "._" prefix in case that could copy the files without copying the problem. That didn't work, but I wanted to include that here in case it's helpful to others.

  1. Open Terminal. (Assuming it's opening to your Home Directory in which the jekyll-sites directory is in.)
  2. Copy and paste the following command into the Terminal then press Enter: zip -r jekyll-sites.zip jekyll-sites -x "._*"; open jekyll-sites.zip
  3. Open Finder and there should now be a jekyll-sites 2 folder in your Home Folder.

Solution: No idea why this worked, but I ended up restarting Finder, which seemed to fix the problem.

7
  • 1
    Before raising the meta question read what on hold is used for apple.stackexchange.com/help/closed-questions and the unclear what you're asking
    – mmmmmm
    Jan 18, 2016 at 19:56
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – bmike
    Jan 18, 2016 at 21:41
  • This may be a shot in the dark workaround however I think it's worth a try. 1. Open Terminal. (Assuming it's opening to your Home Directory in which the jekyll-sites directory is in.) 2. Copy and paste the following command into the Terminal then press Enter: zip -r jekyll-sites.zip jekyll-sites -x "._*"; open jekyll-sites.zip 3. Open Finder and there should now be a jekyll-sites 2 folder in your Home Folder. Can you see all the files/folders in the jekyll-sites 2 hierarchal folder structure or are they still invisible? Jan 18, 2016 at 21:55
  • @user3439894 What does this do?
    – user70848
    Jan 18, 2016 at 22:23
  • It creates a zip archive file of the contents of the jekyll-sites directory recursively while excluding files that start with ._ and whatever the rest of the name is, hence the * and then extracts the zip file which will be the name of the source directly incremented, hence jekyll-sites 2. There can be information in the ._* files that caused the files to be hidden to Finder and by not including them when archived in the zip file and then the remaining files extracted then hopefully the hierarchal folder structure of jekyll-sites 2 will be visible. So try it and see if it works. Jan 18, 2016 at 22:35

2 Answers 2

4

You can use chflags in a Terminal to hide/unhide a file where file is an individual file or folder or when using the -R option, all files/folders within a folder. See: man chflags

Basic syntax to hide a file is:

chflags hidden file

Or folder and everything in it:

chflags -R hidden file

Basic syntax to unhide a file is:

chflags nohidden file

Or folder and everything in it:

chflags -R nohidden file

Note: If the folder is a system folder you'll need to preface the chflags command with sudo, e.g.: sudo chflags nohidden file

Also with OS X 10.11 SIP may have to be disabled, although not sure on that as I'm not running OS X 10.11 and cannot test.

5
  • This is what I get: > chflags nohidden file chflags: file: No such file or directory
    – user70848
    Jan 15, 2016 at 23:17
  • @user70848, Did you read the man page for chflags? Jan 15, 2016 at 23:20
  • I don't know what 'See: man chflags' means.
    – user70848
    Jan 15, 2016 at 23:27
  • In a Terminal you type man chflags and press Enter, then read. In the examples given file is a placeholder and represents the actual name of the file/folder to be unhidden/hidden that you'll type in. Jan 15, 2016 at 23:30
  • Thanks. I've tried this but I still get empty folders. :/
    – user70848
    Jan 18, 2016 at 18:25
4

For just moving files and folders within the hidden folder, it might actually not even be necessary to unhide the folder as long as you know its name—or know how to get it.

For example: I know that a Library folder exists within my user folder but I cannot see it in the Finder:

Screenshot of user home directory

However, I can use CMD+Shift+G to open a prompt where I can type in a folder I want to go to. If that shortcut doesn’t work for you, in Finder’s toolbar select Go > Go to Folder. The input field there actually has tab completion like the terminal does with bash, so you can, e.g., type in ~/Lib, press tab and it will automatically be turned into ~/Library/.

Screenshot of Go To Folder prompt

This, as I mentioned earlier, only works if you know where to find the hidden folder. If you don’t, you can open the Terminal (CMD+Space, type Terminal, press Enter/Return) and get to the closest folder where you think the hidden folder might be and then type ls -al. This lists all files—including hidden ones—as a detailled list. Hidden files usually start with ..

Once you got the exact path, you can try what I wrote above with the Finder’s Go to folder action.

2
  • This doesn't work for me. I get an empty Finder list.
    – user70848
    Jan 18, 2016 at 18:18
  • Actually, I'll say that the folders now show up - although Finder says they can't be found - but they are empty.
    – user70848
    Jan 18, 2016 at 18:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .