Unix/Linux command that expands a compressed file to standard output.
Questions tagged [zcat]
80 questions
0
votes
3 answers
Find a line in a list of .gz files
i around 50 .gz files in a particular directory in linux. i need to find a particular line in each file. currently i am doing by zcat each file.
Eg:
zcat 20160909-custfw.log.7.gz | zgrep BGP | zgrep 145.247.1.62
Output:
Sep 9 17:12:47…

user7315541
- 31
- 6
0
votes
1 answer
How to extract interval/range of rows from compressed file?
How do I return interval of rows from 100mil rows *.gz file?
Let's say I need 5 mil rows starting from 15mil up to 20mil?
is this the best performing option?
zcat myfile.gz|head -20000000|tail -500
real 0m43.106s
user 0m43.154s
sys …

olekb
- 638
- 1
- 9
- 28
0
votes
2 answers
zcat working in command line but not in perl script
Here is a part of my script:
foreach $i ( @contact_list ) {
print "$i\n";
$e = "zcat $file_list2| grep $i";
print "$e\n";
$f = qx($e);
print "$f";
}
$e prints properly but $f gives a…

anonymous_10
- 1
- 2
0
votes
0 answers
pipe zcat stdin into java program that takes multiple inputs
I have a gzipped file that is too large to unzip and save. I'm looking to use zcat to unzip it and feed it into a java program that takes in multiple inputs. This program has the format:
java -jar GenomeAnalysisTK.jar \
-T…

ghgh
- 1
0
votes
1 answer
Shell code- Reading a CSV file by loop and making another one
I have to do Shell code that read CSV file line by line, checking every line in some columns values and making another new CSV file according to the conditions.
I've started the code like this:
FileName=$1
while read line
do
zcat…

Mind5
- 27
- 7
0
votes
2 answers
Using zcat and sed in find -exec
I need to create a big text file using the contents of several gzipped files with a specific name pattern. To do that I used:
find . -name '*dna.toplevel.txt.gz' -exec zcat {} >> all.txt \;
and it worked just fine. The problem is, now I need to…

user3537026
- 13
- 3
0
votes
1 answer
How to stream a gzip built on the fly in Python?
I'd like to stream a big log file over the network using asyncio. I retrieve the data from the database, format it, compress it using python's zlib and stream it over the network.
Here is basically the code I use:
@asyncio.coroutine
def…

amirouche
- 7,682
- 6
- 40
- 94
0
votes
1 answer
How to read 1TB zipped file in minimum time
I am trying to read a zipped file. I am doing this using command tar tf abc.tar.xz. Because the size of the file is 1TB so it takes a lot of time. I am not much familiar with bash script. I have other commands as well such as zcat 3532642.tar.gz |…

MKB
- 777
- 1
- 9
- 27
0
votes
3 answers
Why am I not finding any output files in the desired location?
I am trying to write a processing script and I am stuck at the beginning. It does not seem to be wrong but I cannot simply understand where the error is as it is completing the execution but not giving any output. Any debugging help?
#!/bin/sh …

ivivek_ngs
- 917
- 3
- 10
- 28
0
votes
2 answers
zcat to read gzip files and then concatenate them in Perl
I need to write a perl script to read gzipped files from a text file list of their paths and then concatenate them together and output to a new gzipped file. ( I need to do this in perl as it will be implemented in a pipeline)
I am not sure how to…

AnkP
- 631
- 2
- 9
- 18
0
votes
1 answer
Unable to extract to specific directory
I am trying to extract to file to specific directory but it doesn't produce result.
Command:
zcat /export/home/tceng/Desktop/temp/3.tar.Z | tar -xf - -C /export/home/tceng/Desktop/temp/TestExtractUtility/
if we remove value -C onwards in above…

Anil Bhendarkar
- 51
- 1
- 2
- 7
0
votes
1 answer
zcat filename expansion in for loop
I got these files:
bonds.txt.gz
bonds_201307.txt.gz
bonds_201308.txt.gz
bonds_201309.txt.gz
bonds_201310.txt.gz
bonds_201311.txt.gz
bonds_201312.txt.gz
I have a for loop to go through the files, uncompress them, and find a string with grep:
for f…

LWNirvana
- 47
- 10
0
votes
2 answers
How to use zcat as input to a function in the unix?
I have some very large files, and a server with not a lot of space, plus it takes so much time to unzip these files so I was hoping to use zcat as input to a function?
What I've been using is
$ zcat file1 | samtools view -bS > outputfile
file1 is…

TheFoxx
- 1,583
- 6
- 21
- 28
0
votes
1 answer
invalid predicate zcat
I'm trying to retrieve a file (.gz) and read it automatically after finding it, i want to include this in the [action] part of the 'find' command, unfortunately is for some reason not working.
What i'm doing is:
find . -name *20120805.gz -zcat
What…

JBoy
- 5,398
- 13
- 61
- 101
0
votes
1 answer
xargs string used as an input for agrep
Guys I am using xargs to pass the input for a agrep.I am using xargs like the below
Script:
xargs -L 1 -I string echo "RequestId="string | xargs -L 1 -I string zcat FILEB | agrep -dEOE string
Output till…

User
- 401
- 2
- 8
- 15