0

I was trying to empty the trash from terminal because Xcode was stuck in it, but I accidentally removed the trash from the path and ran sudo rm -rf ~/ I thought for a moment i was changing the directory.

The question is how do I repair the user folders and everything else, icloud and appstore won't login it says unknown error.

Cyb3r
  • 1

1 Answers1

-1

The first thing I would try is to log-out and log-in again. In most cases, this will fix your problem.

If not, you have to create a new user account and transfer the data which is left to this new user account. I don't recommend copying the whole Library to the new user account because it could be that your Library is damaged too. I would just copy individual folders like Application Support, Services and so on.

nohillside
  • 100,768
Laurens
  • 25
  • 2
  • 5
    How does logging out and in again recover data removed by rm -rf ~? Also, be specific, things like "copy individual folders like Application Support, Services and so on." won't help a lot if a user doesn't know what to look for. – nohillside May 31 '20 at 13:12
  • I'm not downvoting this answer because there's nothing "dangerous" in here and it doesn't hurt anything to try this. But I want to post this here so it can be understood what logging in/out does. When you log in, a number of LaunchAgents run and if the files they use like plists don't exist, it will be created as new. You may be asked to (re)authenticate to a service and it will save your credentials thus getting you back into a service (like mail) but under no circumstance is this considered data recovery. Your previous settings and preferences are gone and will have to be recreated. – Allan Oct 28 '20 at 20:12