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

CD2014

macrumors newbie
Original poster
Aug 21, 2014
2
0
Hi,

I have 200,000 files in a folder, and I have a list of 3,000+ files on a plain txt file that I want to delete from of this folder.

How do I remove these 3,000 files from the folder using an automated process?

I looked in Automator and searched on Google but there are only answers for Windows users. If there's a way on Windows then there must be a way for Mac users as well.

I'm running Lion OS on a macbook pro.

Thanks
 

CD2014

macrumors newbie
Original poster
Aug 21, 2014
2
0
It worked but I had problems with the .txt file

Hi, I ran in terminal the line of code at the end:

cd /Volumes/space1; rm `cat remove.txt`

But I had problems with my remove.txt file.

I'm not sure if there is a better way to do it but I had to save it as .txt in Word for Mac with LF at the end to get it to work.

Also the list was too long and I had to use ARG_MAX to find the limit of my argument which meant I had to cut my list into 3 parts

Thanks for the direction
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.