unzip single file and untar single file

Dear friends,

My requirement below-

1] I have a zip file on unix server - ETL_Extracts_20100218175009.zip which is composed of various entity extracts namely... ENTITY1.txt, ENTITY2.txt, ENTITY3.txt etc....

How do I unzip only a single file ..say ENTITY2.txt from this zip file.
CAn you please provide the command??

2] I have a tar file on unix server - etl_20100224230331.tar
How do I untar a single file ..say sample.txt from this tar file
CAn you please provide the command??

Regards,
Suresh

Suresh,

You can use below command to unzip only specified files from zip archive. Eg: To extract ENTITY2.txt file from ETL_Extracts_20100218175009.zip

unzip ETL_Extracts_20100218175009.zip ENTITY2.txt

Thank you

I tested and found similar command hold true for tar as well

tar -xvf ETL.tar ENTITY2.txt