Is there a way to change the file or directory permissions so that I can list the contents of the Mail directory from the Terminal command-line in macOS 10.15.4?

When trying to list the contents, I currently get this error.

$ cd ~/Library/Mail 
$ ls -l 
ls: .: Operation not permitted

The Mail app works without issues. I can see the contents of the Mail folder in the Finder by using the Option key. On earlier macOS versions, I could list the contents from the Terminal without issues. But not any more after migrating to a new MacBook Pro running 10.15.4. What changed?

  • I need to get a directory listing so that I can run rsync to my linux backup server.
    – hotpaw2
    Commented May 15, 2020 at 22:06

1 Answer 1


You need to give Terminal Full Disk Access in System Preferences > Security.

You must log in to answer this question.

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