6

I used to be able to hit tab in order to copy files from ~/Downloads/... using the terminal. It appears security has been tightened in the most recent upgrade because if is try ls ~/Downloads I get:

~ % ls ~/Downloads 
ls: /Users/oleersoy/Downloads: Operation not permitted

How do we fix this?

1
  • 1
    Start by rebooting. Then see if you can browse your downloads folder. BTW hitting Tab in this manner is called “Tab Completion” and it “looks” into the current folder for all the possibilities it can “complete to”. Since it can’t look into the folder, you get the error.
    – Allan
    Commented May 5, 2023 at 13:55

1 Answer 1

11

Downloads is a protected folder on macOS. When you run ls the first time, you should be shown a prompt (sample below) granting access.

If you denied this prompt, or never saw this prompt, you can change your configuration in System Settings. Navigate to Privacy & Security > Files & folders. Expand the entry for Terminal and switch "Downloads Folder" to the on position.

Security prompt granting Terminal.app access to Downloads folder

System Settings Terminal Files & Folders access

1
  • Or give Terminal "Full Disk Access", assuming you'll be ranging all over with it.
    – benwiggy
    Commented May 5, 2023 at 15:14

You must log in to answer this question.

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