unzip single file and untar single file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting unzip single file and untar single file
# 1  
Old 02-25-2010
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
# 2  
Old 02-25-2010
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
Code:
unzip ETL_Extracts_20100218175009.zip ENTITY2.txt

# 3  
Old 02-25-2010
Thank you

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

tar -xvf ETL.tar ENTITY2.txt
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Output file name and file contents of multiple files to a single file

I am trying to consolidate multiple information files (<hostname>.Linux.nfslist) into one file so that I can import it into Excel. I can get the file contents with cat *Linux.nfslist >> nfslist.txt. I need each line prefaced with the hostname. I am unsure how to do this. --- Post updated at... (5 Replies)
Discussion started by: Kentlee65
5 Replies

2. UNIX for Beginners Questions & Answers

Tar and unzip on single command

Hi All, First of all I don't know whether this is possible. or no. Thought of getting experts thought. I am having a tar file which contains zipped file in it . I tried individual command with extraction and it worked tar -tvf TRANS_279.tar -rw-rw-r-- qqa00 1394 2016-10-03 10:39:19... (8 Replies)
Discussion started by: arunkumar_mca
8 Replies

3. Shell Programming and Scripting

Paste 2 single column files to a single file

Hi, I have 2 csv/txt files with single columns. I am trying to merge them using paste, but its not working.. output3.csv: flowerbomb everlon-jewelry sofft steve-madden dolce-gabbana-watchoutput2.csv: http://www1.abc.com/cms/slp/2/Flowerbomb http://www1.abc.com/cms/slp/2/Everlon-Jewelry... (5 Replies)
Discussion started by: ajayakunuri
5 Replies

4. Shell Programming and Scripting

Execution of loop :Splitting a single file into multiple .dat file

hdr=$(cut -c1 $path$file|head -1)#extract header”H” trl=$(cut -c|path$file|tail -1)#extract trailer “T” SplitFile=$(cut -c 50-250 $path 1$newfile |sed'$/ *$//' head -1')# to trim white space and extract table name If; then # start loop if it is a header While read I #read file Do... (4 Replies)
Discussion started by: SwagatikaP1
4 Replies

5. Shell Programming and Scripting

Shell scripting - need to arrange the columns from multiple file into a single file

Hi friends please help me on below, i have 5 files like below file1 is x 10 y 20 z 15 file2 is x 100 z 245 file3 is y 78 z 23 file4 is x 100 (3 Replies)
Discussion started by: siva kumar
3 Replies

6. UNIX for Dummies Questions & Answers

untar a single file from down in the tree

I have a tar file that I need to extract a single file to the current directory. The file I want to extract is located in the tar at the following path inside the tar file: repository/parts/SDCG.tgz I use the following command to extract the file: tar xf delivery.tar... (2 Replies)
Discussion started by: rpinsky
2 Replies

7. UNIX for Advanced & Expert Users

tar and untar the files using single line

Hi, i want tar the files from one location and untar it to other location using single line. Can any one help me zip and unzip using single line command. (2 Replies)
Discussion started by: venikathir
2 Replies

8. UNIX for Dummies Questions & Answers

unzip single file in zip file to STDOUT

Hi, Does anyone know if there is an unzip command similar to tar -xOf $tarBall $fileInTarFile which will untar a single file in a tar ball to STDOUT ? I want to do the same but with a .zip (ZIP archive) file. - Andy ---------- Post updated at 05:56 PM ---------- Previous update... (0 Replies)
Discussion started by: andyatit
0 Replies

9. Shell Programming and Scripting

Need shell script to read two file at same time and print out in single file

Need shell script to read two file at same time and print output in single file Example I have two files 1) file1.txt 2) file2.txt File1.txt contains Aaa Bbb Ccc Ddd Eee Fff File2.txt contains Zzz Yyy Xxx (10 Replies)
Discussion started by: sreedhargouda
10 Replies

10. UNIX for Advanced & Expert Users

how to unzip and extract tar file in single command

In order to save diskspace and avoid of disk full during unzip then extract the tar file is there any tar unzip command would unzip and extract tar at the same time (test123.tar.gz) thank in advance (6 Replies)
Discussion started by: darkrainbow
6 Replies
Login or Register to Ask a Question