Tips: Five different ways how to find your hidden files on macOS

Posted:
in General Discussion
Apple is wise to hide certain key files so that they can't be edited or deleted by accident but this can be very inconvenient from time to time. Fortunately, Apple also provides five completely different ways to reveal them all. AppleInsider details how to pick the right technique for you and then how to use it.




It's probably apocryphal, but there is a story from the ancient days of DOS where a user deleted the file command.com because it wasn't one he'd created. That one move wrecked his PC and reduced it to a state of immobility that wouldn't be equalled until the launch of Windows.

Even today, though, you could do the same right now with your Mac if you found the right files to delete -- but Apple has hidden them all.

It's not so much a case of Apple protecting us from ourselves as it is the company just trying to save themselves some support calls. There's no question: having key system files being hidden is a good thing. That is, until you need to see them to back something up, to troubleshoot a problem or to do something like an application's macros that you set up on one drive and need on another.

There are thousands of invisible files on your Mac but usually the ones we're interested in really just hidden within the Library folder. Without taking certain steps, you can't see this in your account. And within that Library there are files from Apple that your Mac needs in order to run but there are also ones by other companies.

Very many developers store important files in a subfolder of the Library called Application Support, for instance. And we just had a case where we needed to copy those from a failing boot drive.

The easiest way to find hidden files

Remember that most of the time, what's actually hidden is specifically the Library folder. So if you can find that and get inside, you're done.

And you can. Go to the Finder, choose the Go menu, then Go to Folder and type in exactly this: ~/Library/

Press Return or click Go and you're taken into the library. Job done. Now you can find the files you want and do what you need. Except there's the issue of that tilde character, the ~ in what you typed. That's a shortcut which tells macOS to take you to the Library of this Mac and specifically the current boot drive.

When you need more

Say you're like us and you had an external drive you used to boot from. It has its own Library file in your user account and ~/Library/ won't get you anywhere near it.

In theory, you should therefore replace the ~ shortcut with the full path. It will be Your Mac Name/Your Drive/Users/Your Username/Library and that shouldn't be difficult. Yet sometimes it is.

To find out what the full path to type should be, open a Finder window and drill down into the User account. Then right-click on the folder name in the top bar of the window and you'll see the path.

Right click on a Finder window's title bar to see its path
Right click on a Finder window's title bar to see its path


You see it as a series of levels going from the current folder at the top down to the name of your Mac at the bottom. You should then be able to use the Go menu and type in each of those levels as names separated by a slash. Do that, hit Return, you're inside the folder.

Except for some reason it keeps going wrong on us. Each time it is also hard to fathom why because Go will regularly drop us back in whichever folder we started with.

So you can see times when this is the obvious solution but in case you're as prone to mistyping pathnames as we appear to be, there are other options.

Seek, locate

In any Finder window, you can type a search term into the box at top right. Press return and the Mac finds every matching item -- if it's visible. You can use the same tool to show hidden or invisible ones, too.

When you've got the first result up, even if it's an empty folder saying 0 items, you also get an extra bar at the top of the window. It includes a Save button in case you want to do this particular search repeatedly, but next to that is a plus sign.

Tap that and you get a further bar with drop-down options.

Confine searches to just invisible or hidden files
Confine searches to just invisible or hidden files


The list of options you see will vary but you're unlikely to see the one labelled File Visibility. You will, though, see Other. Choose that and pick File Visibility -- it will now be added to the dropdown list.

Select that and then take your choice from the options offered. You can tell the Finder to search for all files that are invisible, visible or both.

It works but it's not very effective. You need to know the name or part of the name of the hidden file you want. And even then, there are oddities. If you search for 'Library' in your users account, for instance, you won't find it.

Documents you've hidden will turn up, various Mac items such as hidden iCloud synchronisation ones will too, but most of the time we need a better solution.

Semi-permanent visibility

Strictly speaking this is a permanent change, not a semi-permanent one. You enter a command in the Mac's Terminal and that's it, you can then see the Library and other invisible files forever.

The trouble is that forever is a long time and it turns out that the Mac hides an amazing number of files. After you've got what you needed, there is so much scrolling by previously invisible files that you'll want to go back to the way Apple intended.

In which case, you just use another Terminal command.

To make your Mac show all invisible files, launch Terminal, type in defaults write com.apple.finder AppleShowAllFiles TRUE and hit return.

Using Terminal to show hidden or invisible items
Using Terminal to show hidden or invisible items


Nothing obvious happens immediately, and nothing will until you restart your Mac, relaunch your Finder or just do the quickest thing -- type killall Finder in Terminal. When you then press Return, the Finder will relaunch and you'll see all these invisible files.

A Finder window showing previously invisible items
A Finder window showing previously invisible items


When you're weary of seeing them, go back to Terminal and now type defaults write com.apple.finder AppleShowAllFiles FALSE. Then hit Return, type killall Finder, hit return again, and everything's back the way it was.

The same Finder window with invisible items hidden
The same Finder window with invisible items hidden

A longer way around

Usually you're looking for a hidden or invisible file because you want to do something with it. You're not just poking about through curiosity. If what you want is to make a copy of it, to make a safe backup, then do exactly that. Use something like Carbon Copy Cloner to make a copy.

Carbon Copy Cloner is a backup utility where ordinarily you click to say you want this entire disk backed up to some particular drive. However, you can instead switch from Copy All Files to Copy Some Files.

Using Carbon Copy Cloner to see all files, hidden or otherwise
Using Carbon Copy Cloner to see all files, hidden or otherwise


When you do that, Carbon Copy Cloner shows you all the files on your Mac, regardless of whether they're hidden or not.

Our new favorite way

Each of these is the best choice in different circumstances. To just rapidly go to the Library on your Mac's current boot drive, little beats the Go menu, for instance. If you're already familiar with Terminal and you're using it for other things, these commands are fast.

Then if you're already backing up then it's simply more efficient to use that same app to show what you're looking for.

However, in all cases and at all times, there is also this. Since macOS Sierra in 2016, there has also been a shortcut keystroke you can use.

Whenever you're in any Finder window, you can hold downCommand and Shift, then tap the period. Command-Shift-Period tells the Mac to show you all invisible files.

Then when you're done, the same Command-Shift-Period keystroke tells it to hide them all again.

It's great that Apple gives us all these different ways to get to our files but it's still a good thing that they hide so many of them in the first place. You're not a new user who's likely to drag .DS_Store into the trash but any one of us can make a slip.



Keep up with AppleInsider by downloading the AppleInsider app for iOS, and follow us on YouTube, Twitter @appleinsider and Facebook for live, late-breaking coverage. You can also check out our official Instagram account for exclusive photos.

Comments

  • Reply 1 of 11
    So they now hide the Library file in the latest version of macOS? Glad I didn’t update.
  • Reply 2 of 11
    First, the ~ in the path doesn't specify "this Mac" it specifies the current user's home folder, wherever that may be. 

    But, there is a much easier way to get to the library. Click the Go menu in the finder, press Option, the Library appears in the list, click it.

    By the way, the Command-Shift-Period shortcut is an excellent tip. 
    edited December 2018 dysamoriamacguibonobobrandominternetperson
  • Reply 3 of 11
    So they now hide the Library file in the latest version of macOS? Glad I didn’t update.
    It took me all of 1 minute to add the Library folder to 'Favorites' so no big deal really.
  • Reply 4 of 11
    So they now hide the Library file in the latest version of macOS? Glad I didn’t update.
    It's been hidden in the last several major versions of OS X. This is not new.

    Note that this article is talking about the Library folder in your personal user folder, not the Library folder in the root directory of your drive. That one is still visible in Mojave.
    edited December 2018 dysamoria
  • Reply 5 of 11
    To go to the Library file in your root directory faster? Open Finder, hold down option key, click Go and there's your hidden Library to just click.
    dysamoria
  • Reply 6 of 11
    Sorry Greg for posting the same thing. I was too quick to reply before reading all the posts.
    greg uvan said:
    First, the ~ in the path doesn't specify "this Mac" it specifies the current user's home folder, wherever that may be. 

    But, there is a much easier way to get to the library. Click the Go menu in the finder, press Option, the Library appears in the list, click it.

    By the way, the Command-Shift-Period shortcut is an excellent tip. 
    SpamSandwich
  • Reply 7 of 11
    dysamoriadysamoria Posts: 2,140member
    The word “how” is superfluous in the article title.
  • Reply 8 of 11
    macguimacgui Posts: 1,248member
    dysamoria said:
    The word “how” is superfluous in the article title.
    Not that I bother with the various grammatical errors that may occur, but that one really jumps out. 
  • Reply 9 of 11
    The Find command in Terminal is very powerful and well worth reading up on.  Power users will get everything they need done with some deft use of Find and Ls.

    For example, if I want to find and list all files on the local drive that match a non-case sensitive string of letters somewhere in its name I use:

    sudo find -x / -iname “*thestring*” -print

    This searches the *entire* local drive, even within the /System and /Library  directories where you typically don’t or shouldn’t need to make changes, but is sometimes useful to locate things.  In this case sudo suppresses a few warnings from the output and isn’t necessary if you only want to search your home folder “~”.

    If you want to save the find results to a text file saved on the Desktop for example, simply add an stdout to the end after -print as follows:

    sudo find -x / -iname “*thestring*” -print > ~/Desktop/SearchResults.txt

    If you’re sure of the name in full you could remove the wildcard characters, and if you’re sure of its case sensitivity use -name instead of -iname.

    For example, if I want to find and delete every .DS_Store file from my home directory I use the following:

    find ~ -name “.DS_Store” -delete

    You can obviously do much much more, and I’ve never needed anything other than trusty old Terminal.
    edited December 2018 jony0
  • Reply 10 of 11
    MarvinMarvin Posts: 14,217moderator
    s.metcalf said:
    The Find command in Terminal is very powerful and well worth reading up on.  Power users will get everything they need done with some deft use of Find and Ls.

    You can obviously do much much more, and I’ve never needed anything other than trusty old Terminal.
    The terminal is useful, especially with grep to search file contents, which Spotlight does but not for hidden folders. For an easy front-end to find files, an app called EasyFind does a decent job:

    https://www.devontechnologies.com/products/freeware.html

    That can search for hidden files/folders including contents and allows regular expressions. The brute-force search method used to be so slow on hard drives but now that SSDs have such fast read speeds at 0.5-3GB/s, an entire drive index can be searched in seconds. Spotlight is still faster looking up an index but those other tools are useful for cases where Spotlight doesn't find things, especially if it hasn't indexed an external or network drive.
    So they now hide the Library file in the latest version of macOS? Glad I didn’t update.
    It took me all of 1 minute to add the Library folder to 'Favorites' so no big deal really.
    You should be able to unhide it again using the terminal:

    sudo chflags nohidden ~/Library
    edited December 2018
Sign In or Register to comment.