Sponsored Content
Top Forums UNIX for Dummies Questions & Answers tar archive with including specific patern files Post 302137396 by porter on Monday 24th of September 2007 06:34:36 PM
Old 09-24-2007
You could use find as follows...

Code:
tar cf file.tar `find . -print -name \*.txt`

or append to the tar file as follows

Code:
find . -print -name "*.txt" | while read N
do
     tar rf file.tar $N
done

and change the 'find' to look for the type of files you want.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tar archive with .Z files

Hello, I have a tar archive full of compressed .Z (compressed with the compress command) files. I have restored the tar to a disk but am looking for a way to uncompress every file in every sub-directory. Under normal circumstances, I would just change directories and "uncompress *" but with 1600... (3 Replies)
Discussion started by: Kun2112
3 Replies

2. UNIX for Advanced & Expert Users

tar subdirectories for specific files

I have a sample directory structire like following # pwd /user/test and I have files like following out.txt A/a.txt B/b.txt C/c.txt (A,B,C are directories ) # tar cvf test.tar * a A/a.txt 1 blocks a B/b.txt 1 blocks a C/c.txt 1 blocks a out.txt 1 blocks But whenever I give (4 Replies)
Discussion started by: ronald_brayan
4 Replies

3. UNIX for Advanced & Expert Users

deleting files after the creation of a tar archive

Hi, I would modify to delete the files after creating the tar archive. How I can modify the following command: tar -cvvf logswitch.tar `find *.log* -mtime +5` It create a tar with files that are older than 5 days. (5 Replies)
Discussion started by: Minguccio75
5 Replies

4. UNIX for Dummies Questions & Answers

Howto Archive Including Hidden Files?

Hi I want to archive the following all the files and directory like listed below: $ ls -a . .. .bash_history .bash_logout .bash_profile .bashrc .emacs .mysql_history public_html .viminfo What I tried is to use the following command $ gtar cvzf allmyfiles.tar.gz * ... (1 Reply)
Discussion started by: monkfan
1 Replies

5. UNIX for Dummies Questions & Answers

Count number of compressed files in a tar.gz archive

Hi Folks, I have a tar.gz compressed file with me, and I want to know the number of files in the archive without uncompressing it. Please let me know how I can achieve it. Regards RK Veluvali (5 Replies)
Discussion started by: vrk1219
5 Replies

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

7. Shell Programming and Scripting

Zip a list of specific files to an archive

Hi all, i've got the following problem: We've got a shell-script, that creates some different files based on several criteria given, using a sql-script. After creating, those files are individually zipped and stored, then sent to a ftp-server. This is all working since 2010, but now they have... (3 Replies)
Discussion started by: Biggreuda
3 Replies

8. UNIX for Dummies Questions & Answers

Remove files from tar archive which are more than 1000 days old.

I am not able to extract/remove files older than 1000 days from a tar archive in linux system. #!/usr/bin/perl @file_list = `find /home/x/tmp/ -name *xxMsg* -ctime +7`; $file_name = '/home/x/tmp/new_archive.tar'; for... (1 Reply)
Discussion started by: DannyV
1 Replies

9. UNIX for Dummies Questions & Answers

Help with number of files in a tar archive

I cant seem to work out how to count the number of executable files in a particular tar archive? Only in a directory as a whole. I also cant work out how to count number of certain file types in a tar archive. Only the directory, pretty stuck :( (9 Replies)
Discussion started by: Razor147
9 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
DLB(6)								   Games Manual 							    DLB(6)

NAME
dlb - NetHack data librarian SYNOPSIS
dlb { xct } [ vfIC ] arguments... [ files... ] DESCRIPTION
Dlb is a file archiving tool in the spirit (and tradition) of tar for NetHack version 3.1 and higher. It is used to maintain the archive files from which NetHack reads special level files and other read-only information. Note that like tar the command and option specifiers are specified as a continuous string and are followed by any arguments required in the same order as the option specifiers. This facility is optional and may be excluded during NetHack configuration. COMMANDS
The x command causes dlb to extract the contents of the archive into the current directory. The c command causes dlb to create a new archive from files in the current directory. The t command lists the files in the archive. OPTIONS AND ARGUMENTS
v verbose output f archive specify the archive. Default if f not specified is LIBFILE (usually the nhdat file in the playground). I lfile specify the file containing the list of files to put in to or extract from the archive if no files are listed on the command line. Default for archive creation if no files are listed is LIBLISTFILE. C dir change directory. Changes directory before trying to read any files (including the archive and the lfile). EXAMPLES
Create the default archive from the default file list: dlb c List the contents of the archive 'foo': dlb tf foo AUTHOR
Kenneth Lorber SEE ALSO
nethack(6), tar(1) BUGS
Not a good tar emulation; - does not mean stdin or stdout. Should include an optional compression facility. Not all read-only files for NetHack can be read out of an archive; examining the source is the only way to know which files can be. 4th Berkeley Distribution 28 Oct 1993 DLB(6)
All times are GMT -4. The time now is 01:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy