117

Can I enter a path to a file and its name instead of selecting a file in Mac OS X file dialog?

I tried just typing into an open dialog but it will just try to "Go to a folder", it won't accept a full path.

I'm on Mac OS X Lion

Ian C.
  • 45,969
valya
  • 4,033

4 Answers4

177

Yes. When the Finder dialog box is active type G to bring up the Go to the folder direct entry dialog. You can enter the path to the file in the dialog using the Unix-type path expressions you'd expect: ~ for your home directory, / for a directory separator, etc.

The Go To File dialog box

Ian C.
  • 45,969
  • 3
    hi. It's 'go to the folder', and it won't work for files (I'm trying on ~/.profile) – valya Oct 05 '11 at 20:32
  • 31
    You can also press "/" or "~" to enter the "Go to the folder:" drop-down, starting the path with "/" or "~" respectively. – joelseph Oct 05 '11 at 21:49
  • 2
    @valya that sucks. I didn't realize it wouldn't let you enter the exact file in the dialog (I don't use it very often myself). Hopefully someone has a better answer. – Ian C. Oct 05 '11 at 22:46
  • no, sorry, Ian, you actually were right - take a look at comments to the different answer – valya Oct 06 '11 at 00:26
  • 4
    Cmd+V not working on "Go to the folder" when copy from webstorm.. grr – Luckylooke Nov 23 '16 at 09:20
  • 1
    Cmd+V is not working. But, right click -> Paste is working. – user674669 Feb 09 '17 at 21:53
  • 1
    This should be the accepted answer. The answer now marked as accepted is an answer to a totally different question. Why does it have so many up votes?? Also, the hidden-files tag in the question is wrong as OP clearly states in a comment that the question is not about finding hidden files. – anothernode Aug 30 '18 at 10:17
  • 1
    Thanks! Why does it have to be so cryptic ? – juanmf Feb 24 '20 at 19:49
  • "I'm so glad this basic necessity is abstracted away from the UI" said no one. Ever. – Kelly Bang Jan 19 '22 at 01:01
73

Since it looks like you're just trying to open a hidden file, in the open dialog press command+shift+. and the hidden files will appear.

Open dialog

Ian C.
  • 45,969
Graham
  • 2,767
  • 15
    thank you. but actually, I'm just looking for a way to minimize my mouse usage. and I hate selecting files like that – valya Oct 05 '11 at 21:02
  • 2
    Once the hidden files are visible, you can type the filename and it will be selected. Alternatively, I suggest a third-party app like LaunchBar. – Graham Oct 05 '11 at 21:03
  • 2
    Once the hidden files are visible, you should be able to type-to-select. – Cajunluke Oct 05 '11 at 21:04
  • 1
    wow, that worked! any chance to have hidden files shown by default? and maybe a tab-completion on the filepath? – valya Oct 05 '11 at 21:20
  • See http://apple.stackexchange.com/questions/5870/how-to-show-hidden-files-and-folders-in-finder for showing hidden files by default. – Daniel Oct 05 '11 at 21:23
  • I'll second LaunchBar. I use that to get to everything on my Mac. – Ian C. Oct 05 '11 at 22:46
  • Ian, but can I use it to replace the "Open File" dialog in applications? I want to open random files smoothly from Sublime Text – valya Oct 06 '11 at 00:26
  • 1
    @valya it won't replace the open dialog, but you can use it to send files to Sublime Text. When I want to open a file I hit Cmd-Space to bring up LaunchPad, find the file and hit TAB and then I send it to the program and there it is. It's awesome. – Ian C. Oct 06 '11 at 15:46
  • Well that's interesting, but id doesn't actually answer the question as given... – drevicko May 28 '13 at 01:59
  • This does not answer the question at all. – jameshfisher Mar 30 '15 at 10:54
2

The really nice thing about the "Go to folder" dialog is that auto-completion works - type the first couple of characters in the name, then TAB, and it fills in the rest of the characters. If you get an error instead (say, you forgot one directory name in the path) you can correct it immediately instead of having to find the mistake at the end. The only significant limitation is that you have to type an absolute path, starting at either your home directory or the file system root. There's no concept of a current directory, as in bash.

1

You can also do a "Utilities > Terminal" Then "open foo.txt" or "open fooApp.app"

"open" also works with folders in finder.

i aliased xdg-open to "open" on my linux boxes for this reason.

If it's a particular file type requiring special app (e.g.: not text) set the association in finder.

EMR
  • 21