Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On a Unix system (or more specifically on Mac OS X) is it possible to show hidden files in only some directories? For example as a developer I want to see the hidden files in my Ruby on Rails projects but not on my desktop as well.

I guess I'm just tired of seeing all these .DS_Store and .trashes files swimming around, any remedies not directly related are welcome too!

share|improve this question
up vote 1 down vote accepted

Opening your project directory with a text editor such as TextMate (Great for RoR!), shows you all the files.

If not, it may be useful to add ".*|" at the beginning of the file pattern you will find in TextMate's Preferences > Advanced > File Pattern:

P.S. I'm not aware of any way to show invisible files only for a given directory. But i would rather not do it if it is possible. I prefer working with the terminal for this sort of things. It's even cooler with TextMate's Command line tool, type:

$ mate any_file_or_directory open it in TextMate

share|improve this answer

Undirectly related solutions welcome?

Well, I recently came across this tutorial which allows you to use the Shift-Cmd-Period shortcut that's already usable in open/save dialog boxes inside Finder as well. It does involve restarting Finder, but since all the windows are all restored it's relatively seamless.

Quite stupid that Finder doesn't have such functionality built in if the open/save dialogs do have such functionality, but ah well.

share|improve this answer

you can write a shell script, eg with bash

shopt -s dotglob
for file in my_rails_directory1/.*  my_rails_directory2/.*
 echo $file
share|improve this answer
dotglob is pointless when you manually use .* – grawity Mar 19 '10 at 15:38
i leave it there in case OP want to list all files, not only hidden – user31894 Mar 19 '10 at 15:44

Does not do precisely what you want, but I use the hiddenfiles widget to toggle visibility. This affects all folders off course, but it's quick to use.

share|improve this answer

You must log in to answer this question.

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