Find file in Time Machine backup with command line

I am looking for a specific file starting with "Screenshot 2019-07-11" with an unknown location in a Time Machine backup. I tried:

$ sudo find /Volumes/TimeMachine/ -type f -name 'Screenshot 2019-07-11*'
find: /Volumes/TimeMachine//.Spotlight-V100: Operation not permitted
find: /Volumes/TimeMachine//Backups.backupdb: Operation not permitted

The error led me to this thread, which uses bypass to execute a command, so I tried this command and got the same error:

$ sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass find /Volumes/TimeMachine/ -type f -name 'Screenshot 2019-07-11*'
find: /Volumes/TimeMachine//.Spotlight-V100: Operation not permitted
find: /Volumes/TimeMachine//Backups.backupdb: Operation not permitted

How can I search for a file in a Time Machine backup with the command line?


In order to access a Time Machine backup from Terminal on macOS Mojave, and later, you'll need to add Terminal to Full Disk Access in System Preferences > Security & Privacy > Privacy for it to work.

enter image description here