0

As the title said, I accidentally added ~/Downloads to Dropbox, then I think Dropbox symlinked the ~/Downloads folder to the corresponding Dropbox folder.

❯ ls -l
total 648
drwx------@   5 anthony  staff     160 May 18 20:09 Applications
drwx------@ 143 anthony  staff    4576 May 17 23:42 Desktop
drwx------@  16 anthony  staff     512 May 10 22:57 Documents
lrwx------+   1 anthony  staff      67 Sep 25  2020 Downloads -> /Users/anthony/Dropbox/My Mac (Yuchens-MacBook-Pro.local)/Downloads

Now I don't want Dropbox anymore and I have completely removed Dropbox from my machine including its dot folder. However, I still can't remove the symlink it left.

I tried:

~ ·············································································
❯ rm -rf Downloads
rm: Downloads: Operation not permitted

~ ·············································································
❯ sudo !!
Alias tip: _ !!
Password:
rm: Downloads: No such file or directory

~ ·········································································· 6s
❯ unlink Downloads
unlink: Downloads: Operation not permitted

~ ·············································································
❯ sudo !!
Alias tip: _ !!
unlink: Downloads: No such file or directory
# macos version
❯ sw_vers
ProductName:    macOS
ProductVersion: 11.3.1
BuildVersion:   20E241

How can I remove it? It looks extremely annoying to me. Many thanks.

3
  • If Dropbox is completed removed (no longer running), try to recreate the folder that's the target of that symlink. Then, try removing the symlink itself, then the target folder. Also, try with rm -f, not sudo.
    – jimtut
    Commented May 20, 2021 at 17:30
  • @jimtut That doesn't work...I still stuck at removing the symlink. I tried unlink and rm -rf, and they all tell me Downloads: Operation not permitted Commented May 20, 2021 at 21:15
  • Try quitting any browsers, which might have an open reference to the downloads folder keeping it from being deleted. Also try logging out of your main user account, and login as a different user, creating it first if you need to. From that account use SU to switch to your account and him directly and try to commands from there.
    – jimtut
    Commented May 20, 2021 at 21:20

1 Answer 1

0

I actually figured it out...

The reason is the Downloads folder is "locked". You can see whether is locked or not by going -> Get Info in the macOS GUI.

ls -l shows that the user priviledge was lrwx------+ meaning that is locked.

Once it's unlocked, the priviledge will become drwx------+ as usual.

You must log in to answer this question.

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