Hello guys, this is my first post here.
Before I reformated my Time Machine Backups drive, I copied several thousands of files to another drive.
After using "Tidy Up!" I constantly had errors telling me I didn't have enough privileges to erase duplicate files. I tried everything I could.
Using chmod -R 775, and chflags -R nouchg made the trick for the first 15,000 files. I even rebooted in single user mode to apply this fix.
I decided to export the path of the missing 5,000 files using Tidy Up!, and after replacing strings with regular expressions in textmate I got something like this:
"/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Dream Yoga and the Practice of Natural Light - Namkhai Norbu.rar" "/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Easy Steps to Yoga.zip" "/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Essence of Yoga.zip" "/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Hatha Yoga Pradipika.rar" "/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Yoga and Yoga Discipline.rar" "/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Yoga Swami Svatmarama_ Hatha yoga pradipika.zip" "/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Yoga.rar"
I thought it'd be as simple as appending this several thousand files into the terminal after rm -f
Of course, an "Argument list too long" dumped.
I thought I could write a shell function like this one adapted to my case:
function large_rm ()
{
while read line; do
rm -rfv $line
done
}
large_rm /Erase/duplicates
Then I changed my file to this: (using \n)
"/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Dream Yoga and the Practice of Natural Light - Namkhai Norbu.rar"
"/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Easy Steps to Yoga.zip"
"/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Essence of Yoga.zip"
"/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Hatha Yoga Pradipika.rar"
"/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Yoga and Yoga Discipline.rar"
"/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Yoga Swami Svatmarama_ Hatha yoga pradipika.zip"
"/Backup/Time Machine/dir_11735865/Desktop/current books/otros+/Ebooks/(Yoga) - Yoga.rar"
But I have no idea how to use this. I have no idea how to use the function in the terminal window. I think I'm missing the grep or something. Then tried the same article's find approach, but I just don't know how to use it either.
find /Erase/duplicates -type f -name '".*"' -exec rm -fv {} \;
What am I missing? The grep, the pipe, the part where the text file is read, escaping the ""... I'm completely lost... Please help me!
Gratefully Yours, V�ctor
PS: Excuse me for my complicated way of expressing myself, English is not my mother tongue :o.