You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

~username folder appeared in the root of Macintosh HD

I got the same issue with this post:

https://discussions.apple.com/thread/251480928?answerId=252883043022#252883043022


I've tried in recover mode and Terminaled this cmd: "rm -rf /~username", but it doesn't work..😠

I guess the folder path is not correct, Anyone can help me pls?


Posted on Aug 17, 2020 8:40 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 23, 2020 8:52 PM

Thank you for you guys reply. I finally figured it out. It's the file path problems, in case someone encounters this problem in the future, the correct file path is:

/Volumes/Macintash\ HD/~username

Last time I didn’t realize needed to add "\", so stupid...

6 replies

Aug 23, 2020 9:12 PM in response to uedvincent

uedvincent wrote:

Thank you for you guys reply. I finally figured it out. It's the file path problems, in case someone encounters this problem in the future, the correct file path is:
/Volumes/Macintash\ HD/~username
Last time I didn’t realize needed to add "\", so stupid...


well this may have solved your problem — but I will add besides blank spaces needing to be 'escaped' as you outline, (or quotes placed around the path) the other important aspect of the command-line is you have to spell correctly as per your example above:


/Volumes/Macintash\ HD/~username



It is easy to get in trouble using the Terminal and not for everyone.

The old computer adage is "garbage in, garbage out."


Terminal User Guide for Mac - Apple Support

Execute commands and run tools in Terminal on Mac - Apple ...



Aug 18, 2020 5:12 AM in response to uedvincent

I've tried in recover mode and Terminaled this cmd: "rm -rf /~username", but it doesn't work..😠
I guess the folder path is not correct, Anyone can help me pls?

You would need to make sure the drive is mounted when in Terminal in Recovery. If the drive is encrypted, you will need to use Disk Utility to mount the drive.

And, as you mention, you would need to know exactly where the file is located on the system while in Recovery as it may not be where it appears. It could be on Macintosh HD or it could be on Macintosh HD - Data (or possibly somewhere else the OS decides to obfuscate).


And, even in Recovery, you may have to disable SIP as HWTech noted. That's not what I would suspect, but the security model could be such that it is required even in Recovery.

Aug 23, 2020 9:19 PM in response to uedvincent

To add to @leroydouglas' excellent post (and a good eye catching the typo) you can avoid the problem with spaces in the path by pressing the Tab key to auto-complete the path or part of a path. Using the Tab key to assist you will automatically add the "\ " escape sequences to the path and it can save lots of typing and other mistakes. The Tab key will auto-fill a path until it encounters multiple file/folder options that will require you to manually type enough unique characters to allow it to know which item should be used for the auto-fill.


Here is an article that may explain this better as it provides some examples. Even though it references Linux, the tab completion feature works the same way with macOS.

https://www.howtogeek.com/195207/use-tab-completion-to-type-commands-faster-on-any-operating-system/

~username folder appeared in the root of Macintosh HD

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.