piątek, 15 lutego 2013

"too many arguments" problem with tar large files set

Unix commands have some limits in arguments number. I had a 500k files set and wanted to tar in into one big archive. It was not so easy as I expected. I used this command first
 tar -cvzf ../archive.tar.gz *xml 
Didn’t work. It gives "too many arguments" message. After a little research I've created file with files names which I want to pack into tar archive and used this file.
find . -name '*.xml' -print | tar -cvzf ../arch.tar.gz --files-from -
this approach is very useful not only for tar command but also for others like rm, cp, mv...

Brak komentarzy:

Prześlij komentarz