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!


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

...to open it in TextMate

|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.

|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
|improve this answer|||||
  • dotglob is pointless when you manually use .* – user1686 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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.