MacOS – CLI unable to access files on external disk

command linemacospermission

I have an external disk onto which I backed up my macOS 10.13 laptop, and now I want to pull some of the files off to use on my newer macOS 10.15 laptop.

I can both see and open (read/write) the files I want via the Finder. But I cannot see them nor open them via the command line. Permissions look right, according to Finder, i.e. my macOS 10.15 user owns the files and has read/write permissions.

What's preventing the CLI from accessing these files?

Image below shows very bottom of Finder window overlapping terminal window running Bash. Note how Finder displays filename and modify date, but file is invisible to Bash. Next image shows Finder Info for that file.

enter image description here

enter image description here

Best Answer

Apple sandbox privacy now applies to the terminal app as well as specific binaries in some cases.

As a developer, you can script for this.

Even Apple tools need to be granted access and you have to approve it with a click.

Until you grant permission to look at the disk, the permissions will show incorrectly.