Skip to content

Instantly share code, notes, and snippets.

@smw
Created May 10, 2014 09:45
Show Gist options
  • Save smw/e7202b2dc40abab792ba to your computer and use it in GitHub Desktop.
Save smw/e7202b2dc40abab792ba to your computer and use it in GitHub Desktop.
A reasonable approximation of Everything Search's command line interface, es.exe, under OS X.
#!/usr/bin/perl -w
if (@ARGV < 1) {
print "Usage: es <file glob to search for>\n";
exit(1);
}
my $nameGlob = shift @ARGV;
exec ('mdfind', qq(kMDItemDisplayName=='${nameGlob}'c), @ARGV) or
print $STDERR "Couldn't find mdfind: $!";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment