Nobody's mentioned the O/S or how the data was compressed.
A general answer is a combination of the above posts. You have to decompress but it can be to a pipeline through "zcat".
The switches to the "tar" are:
t = list files rather than extract them
f = filename of archive (in this case "-" which means read from pipeline).
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)
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)
Hi,
I need to create recursive tar archive, while I put there only files of type a*.txt.
Without file filtering the command is: tar cfzf test.tar.gz test_tar/
How I include the switch for including only files with pattern a*.txt ?
Thanks a lot! (1 Reply)
Is it possible to update a file in a compressed archive.tgz using the tar app without uncompressing/extracting, update and compressing/creating ?
tar -uvzf archive.tgz ./file.txt
tar: Cannot update compressed archives
Try `tar --help' for more information. (1 Reply)
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)
Hi!
I just want to count number of files in a directory, and write to new text file, with number of files and their name
output should look like this,,
assume that below one is a new file created by script
Number of files in directory = 25
1. a.txt
2. abc.txt
3. asd.dat... (20 Replies)
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)
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)
How to download in bulky compressed (zip, 7z, bzip, xz, etc) archive files from a repository automatically by use of wget ? (3 Replies)
Discussion started by: abdulbadii
3 Replies
LEARN ABOUT AIX
zcat
Commands Reference, Volume 6, v - zzcat_Command
Purpose
Expands a compressed file to standard output.
Syntax
zcat [ -n ] [ -V ] [ File ... ]
Description
The zcat command allows the user to expand and view a com-
pressed file
without uncompressing that file. The zcat command does not re-
name the
expanded file or remove the .Z extension. The zcat command
writes the
expanded output to standard output.
Flags
-n Omits the compressed file header from the compressed
file.-V Writes the current version and compile options to stan-
dard error.
Parameters
File ... Specifies the compressed files to expand.
Return Values
If the zcat command exits with a status of 1 if any of the
following
events occur:
* The input file was not produced by the compress command.
* An input file cannot be read or an output file cannot be
written.
If no error occurs, the exit status is 0.
Exit Status
0 Successful completion.
>0 An error occurred.
Examples
To view the foo.Z file without uncompressing it, enter:
zcat foo.Z
The uncompressed contents of the foo.Z file are written to
standard
output. The file is not renamed.
Related Information
The compress command, pack command, uncompress command,
unpack command.
Commands in Operating system and device management.
________________________________________________________________________________
Commands Reference, Volume 6, v - z
zcat_Command
Purpose
Expands a compressed file to standard output.
Syntax
zcat [ -n ] [ -V ] [ File ... ]
Description
The zcat command allows the user to expand and view a com-
pressed file
without uncompressing that file. The zcat command does not re-
name the
expanded file or remove the .Z extension. The zcat command
writes the
expanded output to standard output.
Flags
-n Omits the compressed file header from the compressed
file.-V Writes the current version and compile options to stan-
dard error.
Parameters
File ... Specifies the compressed files to expand.
Return Values
If the zcat command exits with a status of 1 if any of the
following
events occur:
* The input file was not produced by the compress command.
* An input file cannot be read or an output file cannot be
written.
If no error occurs, the exit status is 0.
Exit Status
0 Successful completion.
>0 An error occurred.
Examples
To view the foo.Z file without uncompressing it, enter:
zcat foo.Z
The uncompressed contents of the foo.Z file are written to
standard
output. The file is not renamed.
Related Information
The compress command, pack command, uncompress command,
unpack command.
Commands in Operating system and device management.