Is there a way to extract a single file from a tar file to a specific directory?
In fact, I am dealing with a .tgz file so, I am attempting something like this :
gunzip -c mytargzfile.tgz | tar xvf - path/to/myfile -C /tmp
In order to extract a file entry called path/to/myfile in mytargzfile.tgz to /tmp directory.
But this command fails as tar complains saying it can not find file named -C and /tmp in the archive. I tried switching -C option before xvf and it did not help either.
Note that I am using AIX, and KSH