find a data from several .tar,.gz files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers find a data from several .tar,.gz files
# 1  
Old 11-10-2006
find a data from several .tar,.gz files

Hi

I have a several files with .tar or .gz in a known location.

i have files with one of the several files of .tar or .gz
text.txt
help.pl
move.txt

how do i write a script to find out those particular files .tar or .gz where that contains the above mentioned files (i.e, text.txt,help.pl,move.txt)
# 2  
Old 11-10-2006
the -t or --list option of tar command shows list of files present withing given tar file. this option will help you.
# 3  
Old 11-10-2006
Try
Code:
tar -tvf *.tar | egrep "text.txt | help.pl | move.txt"

Tornado
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Files count mismatch when used with Tar with find

Hi I have used the below steps and found some discrepancies step 1 : find ./ -type f -mtime +7 -name "*.00*" | wc -l = 13519 ( total files ) ( the size of this files is appx : 10GB ) step 2: find ./ -type f -mtime +7 -name "*.00*" | xargs tar zcvf Archieve_7.tar.gz step... (7 Replies)
Discussion started by: rakeshkumar
7 Replies

2. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

3. Shell Programming and Scripting

Find *.tar files under all subdirectories

Hi there, I'm new to shell scripting... I've a situation like to find *.tar files under all subdirectories in "/home/abcd" and i used the below, find /opt/lhapp ! -name "temp" | more the above works fine.. Now don't need search few direcotries like "/home/abcd/aaaa",... (15 Replies)
Discussion started by: skcvasanth
15 Replies

4. Shell Programming and Scripting

How to find the matching data b/w 2 files in perl?

Hi friends,, i have find the matching data between 2files. My file1 have a data like rs3001336 rs3984736 rs2840532 File2 have a data like rs3736330 1 2359237 A G 0.28 1.099 0.010 rs2840532 1 2359977 G A 0.363 0.3373 1.123 rs3001336 1 ... (4 Replies)
Discussion started by: sureshraj
4 Replies

5. Programming

How to find the matching data b/w 2 files in perl?

Hi friends,, i have find the matching data between 2files. My file1 have a data like rs3001336 rs3984736 rs2840532 File2 have a data like rs3736330 1 2359237 A G 0.28 1.099 0.010 rs2840532 1 2359977 G A 0.363 0.3373 1.123 rs3001336 1 2365193 G A 0.0812 0.07319 1.12 ... (1 Reply)
Discussion started by: sureshraj
1 Replies

6. Shell Programming and Scripting

find files older than and containing then tar.

I'm tring to: find files recursively older than x days that contain dat or DAT then tar them I can find the files older than 90 days containing dat with this: find . -mtime +90 -type f -name "*dat*" -exec tar -cvvfp /some/path/some.tar {} \; but how do I do it case insensitive? ... (3 Replies)
Discussion started by: Ikon
3 Replies

7. Shell Programming and Scripting

Find most recent files in dirs and tar them up?

Hey all.. This should be simple but stoopid here can't get head around it! I have many directories, say 100 each with many files inside. I need a script to traverse through the dirs, find most recent file in each dir and add it to a tar file. I can find the files with something like for... (1 Reply)
Discussion started by: bobdung
1 Replies

8. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

9. Shell Programming and Scripting

find and tar 700 files

i have some 700 files of the same pattern differing only in their datestamp. below some of the files. i want to tar them all into one tar file.but the below normal command is telling me "arg list too long" tar -cvf Archive1.tar CurrentCollectorMeterReadBackup* also i tried the below... (6 Replies)
Discussion started by: ali560045
6 Replies

10. Solaris

Find files older than x days and create a consolidated single tar file.

Hello, I need help in finding files older than x days and creating a single consolidated tar file combining them. Can anyone please provide me a script? Thanks, Dawn (3 Replies)
Discussion started by: Dawn Bosch
3 Replies
Login or Register to Ask a Question