Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

"terminal" app can't access time machine backup

I'm trying to use the "terminal" app to look at the contents of a time machine backup drive, but for some reason I don't have permission. This is happening on two different Monterey setups; one is a 2019 iMac that I just upgraded to Monterey, and the other a brand new Macbook Pro setup for work. Different TM drives in both cases. Here's an example of what I'm running into:


$ cd /Volumes/
$ ls
BigMac	BigMac_tm
$ ls BigMac_tm
ls: BigMac_tm: Operation not permitted
$ sudo ls NewBigMac_tm
Password:
ls: BigMac_tm: Operation not permitted


This is all very odd since from the Finder I can look at anything on this drive. However, even in the Finder the permissions look a bit odd. For the drive is says "You can only read", and for folders at the root of the drive (each backup folder) it says "You have unknown access". There is also no way to change the permissions.


I'm using terminal because I want to grab some hidden files from my home directory, and I can't see these in the finder.

iMac 27″, macOS 12.2

Posted on Mar 15, 2022 12:47 PM

Reply
Question marked as Best reply

Posted on Mar 15, 2022 6:25 PM

You must grant Terminal Full Disk Access rights. To do this:


1: Open System Preferences


2: Select the Security & Privacy preference pane


3: Select the Privacy tab


4: Press the padlock icon in the bottom left corner and authenticate using your local admin account


5: In the list of services on the left, select Full Disk Access


6: Add Terminal to the list on the right associated to Full Disk Access - if Terminal is already in the list, just check the checkbox. If Terminal is running, you will be prompted to Quit and Relaunch. Choose to do so as the PPPC (privacy preference policy control) right will not apply dynamically to a running app. If Terminal does not auto-launch, just launch it manually.


With Full Disk Access granted to Terminal, you will now be able to traverse protected regions of the file system, including the TM folders.


Hope this is helpful.

Similar questions

3 replies
Question marked as Best reply

Mar 15, 2022 6:25 PM in response to cjp987

You must grant Terminal Full Disk Access rights. To do this:


1: Open System Preferences


2: Select the Security & Privacy preference pane


3: Select the Privacy tab


4: Press the padlock icon in the bottom left corner and authenticate using your local admin account


5: In the list of services on the left, select Full Disk Access


6: Add Terminal to the list on the right associated to Full Disk Access - if Terminal is already in the list, just check the checkbox. If Terminal is running, you will be prompted to Quit and Relaunch. Choose to do so as the PPPC (privacy preference policy control) right will not apply dynamically to a running app. If Terminal does not auto-launch, just launch it manually.


With Full Disk Access granted to Terminal, you will now be able to traverse protected regions of the file system, including the TM folders.


Hope this is helpful.

Mar 16, 2022 1:01 PM in response to cjp987

cjp987 wrote:

I'm using terminal because I want to grab some hidden files from my home directory, and I can't see these in the finder.

In the Finder you can toggle hidden files on & off using these keys:

Command + Shift + . (the last one is a dot or period).


FYI, I don't use TM, but my understanding is you are not supposed to access the TM backups outside of the TM option in Finder due to how TM links everything for the backups.

Mar 15, 2022 9:21 PM in response to cjp987

Thanks that fixed it, along with another problem I just noticed, which is when in my home directory I couldn't even get simple "mv" commands to work. Now they work.


One odd thing about the TM volume though. It only shows a directory for the most recent backup, whereas in the finder I can navigate to older backups. It must have something to do with how snapshots work, and I guess from the terminal that's something you can't see.

"terminal" app can't access time machine backup

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.