Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've made a mistake of moving my .vimrc file from my home directory and now I don't know how I'm able to locate it. I'm still new to Mac and navigating and finding files seems so foreign to me.

Instead of making another copy of my .vimrc file using 'cp' command in Terminal, I've dumbly issued the 'mv' (move) command. This is the command I've issued in my home (~) directory:

mv ~/.vimrc .old_vimrc

Now I can't find my original .vimrc file and can't even locate the '.old_vimrc' file.

Any idea where I can find it? I've wasted hours figuring it out and to no avail.

I'm trying to understand the 'mv' command I've issued above? Did it renamed the ".vimrc" file to ".old_vimrc"? Is that it?

share|improve this question
    
Is your finder showing hidden files? I believe a dot (.) in front of a filename indicates that the file is hidden on a mac. You can enable hidden files by typing defaults write com.apple.Finder AppleShowAllFiles TRUE and then killall Finder. Disable hidden file by typing the two lines again in Terminal, but now with FALSE instead of TRUE –  Bart Arondson Oct 10 '12 at 1:35
    
I've tried it and then searched '.vimrc' or '.old_vimrc' and still didn't show up in Finder. –  Panoy Oct 10 '12 at 1:58
add comment

1 Answer 1

up vote 2 down vote accepted

If you still have the command in your history, you could run history | grep .vimrc.

  • mdfind -name .vimrc: fast, includes files that aren't normally shown by Spotlight, but not files that aren't indexed, like files in folders that start with a period.
  • find / -name .vimrc: slow, includes all files.
  • locate .vimrc: relatively fast, but doesn't include all files and relies on a database that is only rebuilt once per week by default.

You could also use Find Any File, which is faster than find and includes files that aren't indexed by Spotlight.

share|improve this answer
    
Thanks. I downloaded Find Any File and have found the file. –  Panoy Oct 10 '12 at 2:38
add comment

Your Answer

 
discard

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.