finder – Cannot view or manipulate one of MacOS’s “special” folders in Terminal

Spread the love


Advertisement

I've somehow managed to cut myself (and the superuser???) off from my ~/Downloads directory in the Terminal.

Advertisements

  • I did not purposefully enter any Unix commands to change permissions or access.
  • I did install a download helper in my Brave browser at around that time and use it to download an audio file to that directory. (The audio file ended up being corrupted.)
  • I can still access and manipulate the folder using Finder.

Here's how it looks with some context in the Terminal:

drwx------+  10 dmg staff          320 Sep  4 22:31 Desktop/
drwx------+  41 dmg staff         1312 Aug  8 07:10 Documents/
drwx------+   4 dmg _lpoperator    128 Sep  9 14:58 Downloads/
drwx------+  79 dmg staff         2528 Aug 29 17:47 Library/

Here are a variety of things that are now weird about the directory in the Terminal.

~$ /bin/ls Downloads/
ls: Downloads/: Operation not permitted

~$ chgrp staff Downloads/
chgrp: Downloads/: Operation not permitted

~$ sudo /bin/ls Downloads/
Password:
ls: Downloads/: Operation not permitted

~$ sudo chgrp staff Downloads/
chgrp: Downloads/: Operation not permitted

~$ xattr Downloads/
xattr: [Errno 1] Operation not permitted: 'Downloads/'

~$ cd Downloads/

~/Downloads$ /bin/ls -al
total 0
ls: .: Operation not permitted

~/Downloads$ cd ..

~$

I can't recall whether the Unix group of the directory was staff or _lpoperator before whatever I did to the directory (but I'm a member of both groups anyway).

Notice that I can cd to the directory okay and also that I can access the .. pointer to cd back out.

In 27 years of using Unix systems and 20 years of OS X experience, I've never encountered a permissions issue that I couldn't fix with sudo in the Terminal. I'm at a loss as to how to proceed.

If the directory weren't “special” in MacOS's eyes, I would just erase it and create a new one.

P.S. This is on Monterey 12.5.1 on a brand new M1 MacBook Pro.

Author: Subham

Leave a Reply

Your email address will not be published. Required fields are marked *