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.

6
  • 5
    I think you need to start with your backup.
    – Solar Mike
    Commented May 31, 2020 at 10:40
  • @SolarMike Unfortunately I don't have any backups, but i managed to get it working by logging out and in again.
    – Cyb3r
    Commented May 31, 2020 at 11:01
  • 2
    Why would you have needed sudo in order to empty~/.Trash ? Commented May 31, 2020 at 12:23
  • On MacOS 10.13 and newer you might have a backup in TimeMachine even if you don't know it, check this answer and this link in particular for details. Commented May 31, 2020 at 14:09
  • @MarcWilson according to this answer it supposed to be the best way to remove it, and it did remove it eventually.
    – Cyb3r
    Commented Jun 1, 2020 at 13:36

1 Answer 1

-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.

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
    Commented May 31, 2020 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
    Commented Oct 28, 2020 at 20:12

You must log in to answer this question.

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