Thursday, November 3, 2011

xargs tar not found in archive

When you run:

# ls | xargs tar zxvf
tar: test0.tar.gz: Not found in archive
tar: test1.tar.gz: Not found in archive
tar: test2.tar.gz: Not found in archive

You get the error message because xargs read as much as arguments as it can to tar command.

So, you need to limit it to like this:

# ls | xargs -L 1 tar zxvf

No comments: