Trying to delete the following file: ~/Library/Cookies/HSTS.plist, but MacOS won't let me do it even when using sudo.

I just switched to Mac (was using Ubuntu before) and I'm probably missing something obvious. I'm using MacOS Mojave 10.14.1. What could be wrong?

sudo rm -f ~/Library/Cookies/HSTS.plist
rm: /Users/dima/Library/Cookies/HSTS.plist: Operation not permitted

I can't run ls on the folder files:

ls -la ~/Library/Cookies/
ls: : Operation not permitted

Output of ls -lde@ ~/Library/Cookies:

drwx------@ 11 dima  staff  352 Dec 11 23:03 /Users/dima/Library/Cookies
    com.apple.quarantine     -1

I found out I can delete the file using Finder, but not using command line. Why is that?

  • 1
    Can you run an ls on the file and directory? – Alex Dec 10 '18 at 15:33
  • 1
    Welcome to Ask Different :) Go to Finder → Go To Folder... in Menu bar. Enter ~/Library/Cookies. This will open Cookies folder in Finder. Simply select the file and try deleting it by pressing Command + delete key. – Nimesh Neema Dec 10 '18 at 15:47
  • Thanks @Alex, I edited my question to include additional info – Dima L. Dec 11 '18 at 20:05
  • Did you restore your system from backup? And can you run ls -lde@ ~/Library/Cookies as well to show the extended attributes and ACLs (if any)? – nohillside Dec 11 '18 at 20:05
  • 1
    If you'll run ls -ld@ ~/Library/Cookies, you'll see that the Cookies directory has com.apple.quarantine extended attribute set. That's what preventing you from accessing the file. – Nimesh Neema Dec 11 '18 at 20:11

You must log in to answer this question.

Browse other questions tagged .