tisungho
January 19th, 2011, 02:52 PM
Hi,
I have a lot of BIG tarball files in a directory, say, a.tar.gz, b.tar.gz, c.tar.gz ... in /home/myuser/tarball directory
I want to untar ONLY the files with .c extention to /home/myuser/untar. I use this command:
find /home/myuser/tarball -type f -name *.tar.gz -exec tar -zxvf '{}' -C /home/myuser/untar *.c \;
The problem is that I get error when a tarball file doesn't contain any .c file.
Could you please help me work this out?
Thanks!
I have a lot of BIG tarball files in a directory, say, a.tar.gz, b.tar.gz, c.tar.gz ... in /home/myuser/tarball directory
I want to untar ONLY the files with .c extention to /home/myuser/untar. I use this command:
find /home/myuser/tarball -type f -name *.tar.gz -exec tar -zxvf '{}' -C /home/myuser/untar *.c \;
The problem is that I get error when a tarball file doesn't contain any .c file.
Could you please help me work this out?
Thanks!