Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bill99

macrumors regular
Original poster
Aug 16, 2019
102
6
Hello,

just came to know about 'mdfind' a few days ago and it seems it does a very good job, e.g. when the location is not known and it does search files and folders at the same time :)


Question:
But I am wondering why there are compared to 'find' no error messages.... Are the the errors(e.g. because even sudo is not allowed to access certain folders/files) just not displayed?

Thank's a lot in advance!





imac-admin@imac-admins-iMac ~ % sudo find / -type f -name "frutiger"
Password:
find: /System/Volumes/Data/.Spotlight-V100: No such file or directory
find: /System/Volumes/Data/mnt: No such file or directory
find: /System/Volumes/Data/private/var/db/fpsd/dvp: Operation not permitted
find: /System/Volumes/Data/private/var/db/lockdown: Operation not permitted
find: /System/Volumes/Data/private/var/db/searchparty: Operation not permitted
 

frou

macrumors 65816
Mar 14, 2009
1,392
2,002
find is just "dumb" brute-force examining the entire filesystem, while mdfind IIRC is just searching its index that is already maintained on an ongoing basis in the background. So the decision about which locations are off-limits has already been made before you even run the mdfind command.
 
  • Like
Reactions: bill99 and joevt
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.