Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

I would like to find a way to hide all the *~ files in Finder, which are used as backup files by Emacs. Is there a general approach to make Finder hide all the files with their names matching certain patterns? Thanks.

share|improve this question
If you are only concerned about Emacs backup files, would storing them all in a single folder (e.g. ~/.emacs-backups/) be an option as well? – patrix Jun 13 '12 at 12:32
@patrix Thank you, I did so. Sometimes, it's easier to customize the Emacs OS than Mac OS:) – Ning Jun 13 '12 at 14:09
That's truly true. Please post the specific settings for backup-directory-alist etc. as the answer so others can benefit from it in the future. – patrix Jun 13 '12 at 14:11

If you don't like all the #*# and *~ files floating around in your working directory, put the following elisp code in your .emacs file.

;; Put autosave files (ie #foo#) and backup files (ie foo~) in ~/.emacs-backups/.
  '(auto-save-file-name-transforms '((".*" "~/.emacs-backups/autosaves/\\1" t)))
  '(backup-directory-alist '((".*" . "~/.emacs-backups/backups/"))))

;; create the autosave dir if necessary, since emacs won't.
(make-directory "~/.emacs-backups/autosaves/" t)


share|improve this answer

If you want to hide a file from GUI you can use chflags utility, e.g.

chflags hidden *~

As a permanent solution you can install a launchd agent with command

find $HOME -type f -name '*~' -exec chflags hidden '{}' ';'

I used Lingon for that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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