15

I need to access files/folders that are not part of this dialog that comes up the "Finder" or whatever its called. Some of these files might be hidden file types. I can get to them via my terminal no problem. However in this case I need to open the file with a text editor so I can copy and paste everything out of it easily.

But unlike Windows, unlike Ubuntu there seems to be no direct access I can find on the Mac so far that will just let me browse through the file system folder by folder as I please.

What am I missing?

1
  • Just open the file from the Terminal, either using emacs or the open command if you want to use TextEdit. You can copy and paste from the terminal. Dec 11, 2011 at 12:22

2 Answers 2

19

Accessing hidden folders from Finder

If you need to go to a system folder not visible through the "normal" Finder, do the following.

Once you have the Finder dialog open, press Cmd+G. Here, enter the path to the folder you want to open.

enter image description here

Accessing hidden files or folders from a dialog

You can show hidden files from any file open dialog by pressing Cmd+Shift+.. Thanks to @kine for mentioning.

enter image description here

If you want to always display hidden files (those starting with a dot or hidden through the extended file attributes), enter the following in a Terminal:

defaults write com.apple.finder AppleShowAllFiles TRUE

Then, reload the Finder by option-clicking its icon and selecting "Relaunch".

enter image description here

You can also toggle this option more easily with an AppleScript. See this post for instructions on how to save the AppleScript as an application that you can use to toggle the option without having to use a terminal.

Directly opening system files through the Terminal

As per Andrew's comment above, of course you can just enter the following:

open -a TextEdit /etc/hosts
open -a TextEdit ~/.somehiddenfile

Or, even shorter:

open -t /etc/hosts

Since:

-t Causes the file to be opened with the default text editor, as determined via LaunchServices

3
  • 2
    Agree with the above, i tend to just use open from the Terminal since toggling hidden files in Finder is irritating. Also, if you only want to see hidden files in an open/save dialogue (for example you've got TextMate open already and you want to edit /etc/hosts or whatever), press Cmd+Shift+. (dot / full stop) in the open dialogue to enable hidden files there. The setting will be reset the next time you open the dialogue.
    – kine
    Dec 11, 2011 at 15:16
  • 2
    @kine Right. I forgot that one. Added it to the answer, thank you!
    – slhck
    Dec 11, 2011 at 15:22
  • cmd+shift+g to go to the folder (in Ventura at least)
    – Scransom
    Sep 6, 2023 at 6:55
1

I think the easiest way to toggle the visibility of hidden files is by using TinkerTool. Just check 'Show hidden and system files' and click 'Relaunch Finder'. It's free and also gives you access to a bunch of other useful OS settings.enter image description here

You must log in to answer this question.

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