tags:

views:

737

answers:

6

Since the GUI-side of OSX treats all dot-files (such as .htaccess) as hidden, it doesn't display them in any of the graphical UI:s, e.g. Finder or the Open-dialogues.

How can I open a dot-file (.htaccess in this case) in a graphical editor, without doing that thing for all hidden files, universally and without going through Terminal.app?

Edit: I'm on Leopard, if that makes a difference.

Edit2: TextWrangler and TextMate seem to have features that allow you to open hidden files, which partly answers my question.

+1  A: 

If you only want to do this for one specific file, you can create a symbolic link to the dot-file. Open up Terminal.app, cd to the directory containing your dot-file, and run

ln -s .htaccess dot_htaccess

Then you should be able to double-click the file dot_htaccess as a regular file, and any edits you make will really go into .htaccess.

Adam Rosenfield
Well, that is a workaround, certainly...
Henrik Paul
+1  A: 

TextMate (a really nice text editor for OS X) open dialog has a "Show hidden files" option, and TextWrangler (and its big brother BBEdit) has it has a menu item.

Chuck
unfortunately, I don't use TextMate, but mainly NetBeans (and occasionally Smultron/TextWrangler) :/
Henrik Paul
I can't speak to NetBeans, but I believe TextWrangler also has an "Open Hidden" option.
Chuck
Would you look at that. I never noticed the separate open-dialogue (I always use cmd-o)
Henrik Paul
+2  A: 

You could tell Finder to display hidden files as well (enter in Terminal):

defaults write com.apple.finder AppleShowAllFiles TRUE

But that’s not really nice since there are a lot more hidden files. So I recommend to use an editor that allows you to view those in the open dialog like Chuck mentioned.

Gumbo
You can use onyx to do this without the terminal.
Milhous
Sure, there are a couple other ways to do this such as Secrets <http://code.google.com/p/blacktree-secrets/> or the Property List Editor (bundled with Xcode).
Gumbo
+1  A: 

In the command line, for a file named FILE, type:

open -e FILE

The open command will open the file in TextEdit (-e flag). Check out "man open" for more flags (e.g., specify the app to open with -a)

Nerdling
+1  A: 

Smultron (another nice OS X editor mentioned in the comment above and similar to TextMate, but free) has an "Open Hidden..." file menu item that works splendidly for this purpose.

Sad news: Smultron is apparently no longer being developed further beyond v3.5.1 (which requires Leopard), according to a post from its author at its homepage: http://tuppis.com/smultron/

jEdit is another free option that has hidden file support: www.jedit.org/users-guide/vfs-browser.html (sorry for the lack of 'http' in the link -- being a new user, my posts are limited to just one link. Alas...)

A: 

In an "Open File" dialog you can use Command-Shift-. to see dot files.

dharmabruce
Doesn't work for me (OSX Leopard)
Henrik Paul