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

I uninstalled Homebrew using

After running the above commands, I can't find .bashrc and .bash_profle. All files are gone from Documents , Desktop and Downloads :'(

When I do git status on /Users/ava it shows:

# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)

... all the files which are in /Users/ava


 113  cd `brew --prefix`
  114  rm -rf Cellar
  115  brew prune
  116  rm `git ls-files`
  117  rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
  118  rm -rf .git
  119  rm -rf ~/Library/Caches/Homebrew
  120  sudo chown -R $USER:admin /usr/local
  121  ruby -e "$(curl -fsSL"
  122  brew doctor

What just happened?

share|improve this question
You probably have them in Time Machine somewhere, either on an external drive or Time Capsule or in local snapshots. Try restoring your folders from there. I'm not sure if Time Machine can show hidden files like .bashrc; if so, you should follow these instructions before going into Time Machine to restore those files. – echristopherson Aug 17 '13 at 2:55

If git was tracking all the files under /Users/ava then the

rm `git ls-files`

command will have deleted them all (which I imagine is what your git status output is telling you.

If the files you are talking about aren't in that list then I'm not sure which of those rm commands might have caused the problem.

share|improve this answer
Is there any way to undo this? Why did it delete my files from Desktop, Documents, Downloads and .bashrc_profile? – Ava Aug 16 '13 at 22:59
Do you see those files listed in the git output? Actually that's a question too. Why does git still think you have a repository if you removed the .git directory? If the files aren't listed in the git output then you have to hope that they are in the OS X trash (or similar location). Failing that you are talking about data recovery and that's not necessarily a simple task. If you do need the data recovery route you should stop using the drive/computer as soon as possible (every time the computer needs to use the disk it has a chance of stomping over your deleted data). – Etan Reisner Aug 16 '13 at 23:07
No! document/desktop/downloads/.bashrc/.bashrc_profile files dont show up on git status. – Ava Aug 16 '13 at 23:15
The full paths to those files are /Users/ava/Documents, /Users/ava/Desktop, /Users/ava/.bashrc, etc.? And git status from in /Users/ava doesn't list them? I'm assuming it does list other (brew related) files from under /Users/ava though? – Etan Reisner Aug 16 '13 at 23:31
Yes they were all under /Users/ava. No git status does not list them. It shows few of my projects under it but I am not very sure what all went missing and what is remaining. The above mentioned are definitely gone. – Ava Aug 17 '13 at 16:42

This line looks fishy: sudo chown -R $USER:admin /usr/local

Are you an admin? Run groups to find out. I don't know what your original /usr/local ownership settings were, but here's mine (and I regularly use git and brew):

lovelace% ls -dl /usr/local
drwxrwxr-x  18 root  admin  612 Aug  5 15:30 /usr/local

It looks like root:admin should be the owner of /usr/local. Try:

sudo chown -R root:admin /usr/local
share|improve this answer
Part of the point of Homebrew is that you don't need to be root. brew doctor will warn you if you can't write to /usr/local, and recommend you chown the directory back to your user account. – Annika Backstrom Aug 17 '13 at 4:05
groups - 906175167 everyone _appstore netaccounts _appserverusr admin _appserveradm _lpadmin _lpoperator _developer – Ava Aug 17 '13 at 5:45
sudo chown -R root:admin /usr/local gives WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information. To proceed, enter your password, or type Ctrl-C to abort. – Ava Aug 17 '13 at 5:46

You must log in to answer this question.

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