1. extract foo.txt from foo.tar.gz
tar -zxvf foo.tar.gz foo.txt
2. extract path/foo.txt from foo.tar.gz
tar -zxvf foo.tar.gz path/foo.txt
3. extract path/foo.txt from foo.tar.gz to dstpath
tar -zxvf foo.tar.gz -C dstpath path/foo.txt
3. extract path/foo.txt from foo.tar.gz to dstpath, without creating directory
tar --transform 's/.*\///' -zxvf foo.tar.gz -C dstpath path/foo.txt
No comments:
Post a Comment