Sponsored Content
Top Forums Shell Programming and Scripting Extracting specific files from multiple .tgz files Post 302909691 by jfern on Friday 18th of July 2014 10:42:55 AM
Old 07-18-2014
Extracting specific files from multiple .tgz files

Hey,

I have number of .tgz files and want to extract the file with the ending *results.txt from each one.

I have tried

Code:
for file in *.tgz; do tar --wildcards -zxf $file *results.txt; done

as well as

Code:
list=$(ls *.tgz)
for i in $list; do tar --wildcards -zxvf $i *.results.txt; done

without results.
Any help would be much appreciated.

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Is extracting specific files from a zip file possible?

If a zip file contains several zip files, but if the file names of the files needed are known, is there a variation of the unzip command that will allow those few (individual) files to be extracted? --- Example: Zip file name: zip.zip unzip -l zip.zip will display file01, file02, file03, etc.... (1 Reply)
Discussion started by: HLee1981
1 Replies

2. UNIX for Dummies Questions & Answers

Create individual tgz files from a set of files

Hello I have a ton of files in a directory of the format app.log.2008-04-04 I'd like to run a command that would archive each of these files as app.log.2008-04-04.tgz I tried a few combinations of find with xargs etc but no luck. Thanks Amit (4 Replies)
Discussion started by: amitg
4 Replies

3. UNIX for Dummies Questions & Answers

How to reduce multiple files into a specific number of files

Can anyone please let me know how do I reduce files into a specific number of files by cat'ing files? For example: 15 files must be reduced to 1 or 5 or 9 (possible values 1 to 14) (5 Replies)
Discussion started by: aryanbelank
5 Replies

4. UNIX for Dummies Questions & Answers

Extracting specific files from a tar file in HP-UX

I have tried: tar -xfv mytarfile.tar archive/tabv/* tar -xfv mytarfile.tar --wildcards 'archive/tabv/*' tar -xf mytarfile.tar -v --wildcards 'archive/tabv/*' tar -xfv mytarfile.tar --wildcards --no-anchored 'archive/tabv/*' tar -xfv mytarfile.tar --wildcards `archive/tabv/*` and none... (5 Replies)
Discussion started by: zapper222
5 Replies

5. Shell Programming and Scripting

Extracting/condensing text from multiple files to multiples files

Hi Everyone, I'm really new to all this so I'm really hoping someone can help. I have a directory with ~1000 lists from which I want to extract lines from and write to new files. For simplicity lets say they are shopping lists and I want to write out the lines corresponding to apples to a new... (2 Replies)
Discussion started by: born2phase
2 Replies

6. Shell Programming and Scripting

extracting information from multiple files

Hello there, I am trying to extract (string) information ( a list words) from 4 files and then put the results into 1 file. Currently I am doing this using grep -f list.txt file1 . and repeat the process for the other 3 files. The reasons i am doing that (a) I do know how to code (b) each file... (4 Replies)
Discussion started by: houkto
4 Replies

7. Shell Programming and Scripting

extracting columns falling within specific ranges for multiple files

Hi, I need to create weekly files from daily records stored in individual monthly filenames from 1999-2010. my sample file structure is like the ones below: daily record stored per month: 199901.xyz, 199902.xyz, 199903.xyz, 199904.xyz ...199912.xyz records inside 199901.xyz (original data... (4 Replies)
Discussion started by: ida1215
4 Replies

8. Shell Programming and Scripting

Extracting non multiple files via script

Hi, Can somebody help me? I am testing a demo with the given function PATH525="/uscms/home/emily/READme/extra/data/" TEMP=temp FileName=DataFileName CopyFiles() { # PATHNAME="$paths" ... (9 Replies)
Discussion started by: emily
9 Replies

9. Shell Programming and Scripting

Extracting data from specific rows and columns from multiple csv files

I have a series of csv files in the following format eg file1 Experiment Name,XYZ_07/28/15, Specimen Name,Specimen_001, Tube Name, Control, Record Date,7/28/2015 14:50, $OP,XYZYZ, GUID,abc, Population,#Events,%Parent All Events,10500, P1,10071,95.9 Early Apoptosis,1113,11.1 Late... (6 Replies)
Discussion started by: pawannoel
6 Replies

10. UNIX for Beginners Questions & Answers

Linux read specific content file from tar.gz files without extracting

hello i wish to write the result of these below conditions in a file: 1. in a specific folder, i have many tar.gz files. 2. each tar.gz file contains ".dat" file in sub folders. 3. i wish to get the full path of these .dat files, if i find in it a specific word ("ERROR24"). 4. all this... (6 Replies)
Discussion started by: jimmyjames9
6 Replies
BOOTCD(1)							   bootcd utils 							 BOOTCD(1)

NAME
bootcdflopcp - copy changes made after booting from bootcd to floppy SYNOPSIS
bootcdflopcp [-v] [-d <device>] DESCRIPTION
bootcdflopcp will copy changes made in ram to the floppy disk. bootcdflopcp will be available as soon as your system is running from cd. The floppy has to have a filesystem already. (See mke2fs or mformat). If you have to boot from floppy, because your cd-drive or bios does not support to boot from cd a msdos filesystem is used to run syslinux. When bootcdflopcp is called it searches for differences between RAM and CD. For each different file, it checks if it is listed in the files ignore, remove or change on floppy. If it is listed in change it will be saved to change.tgz on floppy. If it is listed in remove the file will be removed from ram next boot time. If it is listed in ignore it will be ignored. If it is not listed at all you will be interactively asked what to do. OPTIONS
-v The option "-v" (verbose) adds messages on running. -d <device> Use another device instead of "/dev/fd0" to save changes. FILES
FLOPPY:/remove If a file is listed here the file will be deleted from ram next boot time. FLOPPY:/change If a file is listed here bootcdflopcp will save it in change.tgz. FLOPPY:/ignore If a file is listed here bootcdflopcp will ignore changes to this file. FLOPPY:/change.tgz Here all changed files are stored in gzipped tar format. SEE ALSO
bootcd(1), bootcd2disk(1), bootcdwrite(1) AUTHOR
This manual page was written by Bernd Schumacher <bernd.schumacher@hp.com>, for the Debian GNU/Linux system (but may be used by others). Wed Feb 23 00:00:00 EET 2000 BOOTCD(1)
All times are GMT -4. The time now is 05:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy