What is command to extract single file from an archieve?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users What is command to extract single file from an archieve?
# 1  
Old 12-02-2009
What is command to extract single file from an archieve?

I just want to extract one sigle file from an .ear archieve instead of extracting whole ear.
Can anyone help me on this?
# 2  
Old 12-02-2009
I assume you mean "tar" not "ear".
tar xvf tarfile.name filename
# 3  
Old 12-02-2009
Hi

I mean to say I have one .ear(Enterprise archive) file and I want to extract one file from it.
# 4  
Old 12-02-2009
Enterprise Archived files are compressed jar files. You can simply unpack it using unzip command.

To extract individual files, you can use this

unzip <file.ear> <filename>

Regards,
Kenny N
# 5  
Old 12-08-2009
Hi Kenny,

Thanks for reply. But I donn't want to extract whole package. I just want to extract single file from that package.

Is there any command to achive it?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract a single file from a tar file to another directory

Hi, I need to extract a single file from a tar file to another directory. So far I have this: This one extract a single file to same directory: tar -xvf filename.tar ./file.txt I tried this but its not working tar -xvf filename.tar /home/dir ./file.txt or this: (6 Replies)
Discussion started by: erin00
6 Replies

2. UNIX for Dummies Questions & Answers

[Solved] How to extract single and duplicate lines from file?

Hi, I need help! I have two files, one containing a list of codes and the other a list of codes and their meaning. I need to extract from file 2 all the codes from file 1 into a new file. These are my files: File1: Metbo Metbo Memar Mth Metbo File2: Metbo Methanoculleus... (3 Replies)
Discussion started by: Lokaps
3 Replies

3. UNIX for Dummies Questions & Answers

archieve and zip the multiple file with no extension

Hi, I'm new to scripting. I need to find all the 10 files in the source directory and then archieve them to archive directory. The source files which im getting does not have any extensions just binary files. I need to find them by the file names and archive it. Directory also contains other... (1 Reply)
Discussion started by: etldeveloper
1 Replies

4. UNIX for Dummies Questions & Answers

single line command to delete a 6 months old file

i had this scenario where i need to delete a file that is 6 months old which is no longer needed. basically the filename is in the format of PCARDDAILYmmddyyyy.txt where the mm is the month, dd is the day, and yyyy is the year. e.g. PCARDDAILY05262009.txt PCARDDAILY05252009.txt ... (6 Replies)
Discussion started by: wtolentino
6 Replies

5. UNIX for Dummies Questions & Answers

tar command help -- extract single file

Hi, I want to view/display the contents of one file in tar file. For example if the tar file is sam.tar.gz and one of the file inside is E1.txt, how do i view the contents of this E1.txt file. Olso if I want to extract the E1.txt file only from sam.tar.gz how can i do that. Thanks in... (7 Replies)
Discussion started by: icefish
7 Replies

6. Shell Programming and Scripting

Single line file editing command?

Hello everyone. I have been reading a lot about the various different text editors at my disposal through Unix, but I just can't seem to close the deal for what I am trying to do. Is there a way to issue a single line command to edit a file where pattern=x, and do it non-destructively AND in-place?... (1 Reply)
Discussion started by: gator76
1 Replies

7. Shell Programming and Scripting

tar: extract single file to different filepath

Hi, This is my first post here - I'm hoping I can get some help! I have searched these forums and othersand not getting anything that works. I am trying to extract a single file from a tar archive to a diffierent location than it will default to. For example my tar log shows me ... a... (3 Replies)
Discussion started by: littleIdiot
3 Replies

8. 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

9. Shell Programming and Scripting

extract bulk emails into a single flat file

Hello Can someone guide me how to extract bulk emails into a single flat file ? We receive mails (approx 1K daily ). I want the contents of the emails for 'current date' to be dumped into one single text file. Please help. (1 Reply)
Discussion started by: Amruta Pitkar
1 Replies

10. Shell Programming and Scripting

Extract first file only from ls command

I need help in extracting first file only from an ls command and store it in a local variable I thought using awk we could build something - not very familiar how to do it Something like ls -t $search_string and store the resultant first file alone into a local variable ( as my result... (4 Replies)
Discussion started by: prekida
4 Replies
Login or Register to Ask a Question