Search drive for 2000 files using a list

Joined
Jun 28, 2014
Messages
1
Reaction score
0
I want to be able to search /Volumes/NAS for 2000 files which I have a list of in ~/Desktop/list.txt

The files are buried in a maze of sub-directories and while I could use Spotlight to find each one, I really want to streamline the process. In theory the files are all there and only there once.

I am somewhat familiar with the terminal and tried to perform my search using the xargs and find commands. When I run the following command, I get the following error:

$ sort ~/Desktop/list.txt | xargs find /Volumes/NAS -name -and -not -path *ABCXYZ\ Key\ Exhibits*
find: filename.pdf: unknown primary or operator

I want to exclude files in the /Volumes/NAS/ABCXYZ Key Exhibits folder, which is the reason for the -and -not -path portion.

Had this worked I wanted to pipe the output into xargs and cp commands to copy the PDF files into another folder.

Any ideas what went wrong with my xargs find operation?

If this is a stupid way of doing it, I am open to other suggestions. It seems like Automator could do this, but I was unable to use my list.txt file and if I have to make 2000 separate Automation files, then I might as well use Spotlight.

Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top