I have a list over about 10k items I need to delete in a txt file.
I started here: Unix: How to delete files listed in a file
but ran into
rm: 721_0199_01.mov\r: No such file or directory
Looks like I need it to ignore / not pass '/r'
So, I go here: xargs and find, rm complaining about \n (newline) in filename
where it looks like maybe :
xargs -d '/r' rm < my-big-list.txt
but it complains:
xargs: illegal option -- d
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
[-L number] [-n number [-x]] [-P maxprocs] [-s size]
[utility [argument ...]]
I can't find -d in any man page I look at for xargs, so not sure where to go from here....
Am I way off, did I miss read?
THANK YOU!
Well - Again, thank you all, I did get rid of the /r, but I have tons of whitespace in these filenames, which leads me to:
How can I make xargs handle filenames that contain spaces?
and
-0 Change xargs to expect NUL (``\0'') characters as separators, instead of spaces and newlines. This is expected to be used in concert with the -print0 function in find(1).
And that to:
Linux: Redirecting output of a command to "find"
But that's not really helping...
rad vans Skype Testccc995141.vid
rad vans Skype Testccc995142.vid
rad vans Skype Testccc995143.aiff
rad vans Skype Testccc995144.aiff
rad vans Skype Testccc995145.qtc
rad vans Skype Testccc998bf.mov
rad vans Skype Testccc998bf1.vid
rad vans Skype Testccc998bf2.vid
rad vans Skype Testccc998bf3.aiff
rad vans Skype Testccc998bf4.aiff
rad vans Skype Testccc998bf5.qtc
is a good example of what I'm trying to delete - I suspect this list is about 60% of the contents of the directory...
Is there some trick to use Find?
THANKS!