LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Problem with tar (https://www.linuxquestions.org/questions/linux-general-1/problem-with-tar-396004/)

FredrikN 12-23-2005 03:30 PM

Problem with tar
 
Hello there.

I'm trying to archive some files where the names contains spaces like

movie hello.mpeg
movie go away.mpeg
linux questions.mpeg

Without spaces the command
tar -cvf ark.tar.gz `find -name "*.mpeg" -print`
will solve the question.

But how can I deal with the spaces ?

Thanks

FredrikN 12-23-2005 04:10 PM

Problem solved.

The trick was to use xargs -0 (terminate by a null char)

find -print0 -name "*.mpeg" | xargs -0 tar -czf archive.tar.gz


All times are GMT -5. The time now is 12:40 AM.