How to unpack only TAR or ZIP package to a document bag

zip

First of all have to view the path you want to extract the file:

unzip -l
unzip -v

After viewing the good path in extraction:

unzip -p abc.zip aaa/bbb/ccc.txt -d /tmp

With Note:
Adding to the zip file inside: zip -m abc.zip abc.txt
exclude a file compression: zip -r abc.zip / abc -x /abc/lych.txt
delete a file unzip the bag: zip -d abc.zip lych.txt

tar package

First of all have to view the path you want to extract the file:

takes -tf

tar -xvpf abc.tgz aaa/bbb/ccc.txt

Guess you like

Origin blog.51cto.com/2012ivan/2427698