Super User is a question and answer site for computer enthusiasts and power users. 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 have a file called ".hgignore copy" and I want to rename it to ".hgignore". With a regular file, if I click on the name in the finder, I can change it. But with a hidden file, it won't let me do that. How can I change the name?

share|improve this question
It won't show the file, it won't let you click on the file, or it won't let you rename it? Which? – Ignacio Vazquez-Abrams Dec 10 '10 at 14:53
up vote 10 down vote accepted

In the worst case you could always open a terminal and rename it there.

mv ".hgignore copy" .hgignore
share|improve this answer
typed faster, i'll delete mine – RobotHumans Dec 10 '10 at 14:54

The easiest way, I've found, is to CTRL(right)-click on the file, choose Get Info, change the name in the Name and Extension box, and hit Return (or just close the Get Info window).

share|improve this answer
The OP asked about when files are invisible. If they are invisible (and not made visible like in Daniel Beck's answer) you can not do this. This answer doesn't help at all. – Rich Homolka Apr 12 '13 at 19:02
@Rich Homolka He asked about hidden files - you can change OSX to display hidden files (dotfiles) in finder. This answer works well if you have made your hidden files visible. – James Zaghini Nov 26 '13 at 22:42

You can rename the file in Terminal by entering

mv .hgignore\ copy .hgignore

You can also enable displaying of hidden files in Finder by entering

 defaults write AppleShowAllFiles TRUE

in Terminal and restarting Finder by entering

 killall Finder


A more user-friendly alternative to the second part of this answer is the use of Secrets, a "preference pane" extension for System Preferences, that lets you set this "hidden files" option for Finder in a more userfriendly way.

share|improve this answer
Blacktree link is no longer valid. It would be great if there was a com entry for renaming hidden files. – RobW Dec 2 '15 at 19:13

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.