Cannot ls ~/.Trash in the Terminal in Catalina (operation not permitted)

catalinapermissionterminaltrash

Ever since buying a new Mac, which has forced me to upgrade to Catalina, I cannot view the Trash folder in the Terminal. ls ~/.Trash just gives ls: .Trash: Operation not permitted. So does sudo ls ~/.Trash. According to ls -al ~, the permissions for ~/.Trash are drwx------, and the owner is me. sudo chmod a+x ~/.Trash and sudo rm -rf ~/.Trash both fail with the same error.

Is it possible to view the Trash in the terminal in Catalina?

Best Answer

You have to give the Terminal.app Full Disk permissions in the security settings.

enter image description here