114

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

1

4 Answers 4

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

10
  • 14
    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 5, 2011 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 5, 2011 at 21:03
  • 2
    Once the hidden files are visible, you should be able to type-to-select.
    – Cajunluke
    Oct 5, 2011 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 5, 2011 at 21:20
  • 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 6, 2011 at 15:46
174

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

9
  • 3
    hi. It's 'go to the folder', and it won't work for files (I'm trying on ~/.profile)
    – valya
    Oct 5, 2011 at 20:32
  • 29
    You can also press "/" or "~" to enter the "Go to the folder:" drop-down, starting the path with "/" or "~" respectively.
    – joelseph
    Oct 5, 2011 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 5, 2011 at 22:46
  • 4
    Cmd+V not working on "Go to the folder" when copy from webstorm.. grr
    – Luckylooke
    Nov 23, 2016 at 9:20
  • 1
    Cmd+V is not working. But, right click -> Paste is working.
    – user674669
    Feb 9, 2017 at 21:53
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.

You must log in to answer this question.

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