How to make this command work? sudo find / -maxdepth 4 -size +10M -type f | grep -v "Operation not permitted"

Viewed 15

I am trying to create a pipeline to find files with size, save it in another file after sorting but unable to get rid of "Operation not permitted". Trying below command:

''' sudo find / -maxdepth 4 -size +10M -type f | grep -v "Operation not permitted" -exec ls -lh {} ; | sort -k 5  | tee super_secret_stuff/filesizes.txt '''

Figured out that issue in in find + grep itself:

''' sudo find / -maxdepth 4 -size +10M -type f | grep -v "Operation not permitted"
find: /Library/Application Support/com.apple.TCC: Operation not permitted /usr/bin/parl5.30 /usr/bin/fileproviderctl '''

How can I achieve this without using different command altogether?

0 Answers
Related