Zgrep equivalent-


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Zgrep equivalent-
# 1  
Old 03-03-2009
Zgrep equivalent-

Hi guys
I cant use zgrep on a SunOS
Do you know any alternative for it?
i need to use
zgrep -c
grep works fine
but zgrep is not supported
# 2  
Old 03-04-2009
Msg deleted

Last edited by Whiteboard; 03-04-2009 at 05:07 AM..
# 3  
Old 03-04-2009
First, I have to say that I wasn't aware of such tool - zgrep - but I found it really useful for a specific task today. Thanks for sharing that piece of knowledge.
Now, if you want to process gzip-ed file under Solaris, you can use "gzcat FileName | grep -c Your-Pattern" as a workaround.
# 4  
Old 03-04-2009
It worked great! Thanks sysgate
# 5  
Old 03-04-2009
And on systems without gzcat, you can just 'gunzip < filename'.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Zgrep output to another compressed file

Hi, I have a big (~15G) compressed file having around 170M records and I need to exclude around 4k bad records (\n in the string) . The typical steps would have been 1. zgrep required records into new file zgrep big15GFile.dat.gz > newBig64GFile.dat 2. zip back new file gzip... (1 Reply)
Discussion started by: iamwha1am
1 Replies

2. UNIX for Dummies Questions & Answers

Usage of zgrep

Hi, I have multiple files with name pattern as *.tar.gz, I want to search a standalone string inside it.zgrep -a 707794 *.tar.gz Result: aa.tar.gz: 1|2|7.0707794|a|b|c ab.tar.gz: 1|2|7.0000000707794|a|b|c ac.tar.gz: 1|2|986707794|a|b|c ad.tar.gz: 1|2|007700707794|a|b|c ae.tar.gz:... (1 Reply)
Discussion started by: nerojap02
1 Replies

3. Shell Programming and Scripting

zgrep cannot find all matches

$ cat 1.csv abc in csv $ cat 1.mnf abc in mnf $ zip 1.zip 1.csv 1.mnf adding: 1.csv (stored 0%) adding: 1.mnf (stored 0%) $ zgrep abc 1.zip abc in csv How come zgrep cannot find "abc in mnf"? Thanks in advance. (5 Replies)
Discussion started by: carloszhang
5 Replies

4. UNIX for Dummies Questions & Answers

Using grep and zgrep then display the next few lines

Hello everyone. I would like to know if I can use grep or zgrep to search for a particular pattern then print the x number of lines after the pattern was found. Lets say for example a pattern was found on line 3, I wanted the output to show lines 3, 4 and 5. Thanks! (10 Replies)
Discussion started by: khestoi
10 Replies

5. Shell Programming and Scripting

Zgrep works at command line but not in script?

Hi all- I'm trying to search through some .gz log files to verify certain feeds have passed through our app. I have a small script that I wrote in hopes that I could automate the checking but haven't been able to get the zgrep to work. When I copy it to the command line directly it works... (2 Replies)
Discussion started by: Cailet
2 Replies

6. HP-UX

lsof equivalent in HP-UX

I need lsof equivalent in HP-UX. I do not want to add lsof utility separately. (1 Reply)
Discussion started by: deo_kaustubh
1 Replies

7. Shell Programming and Scripting

help using zgrep

can any body help me i want to find 200 numbers(telephone numbers) in current directory with all sub directories with file name dump*.gz i am having 3000 .gz files to be searched i tried this command find . -name "dump*.gz" -exec zgrep -e '9425376533' {} \; but no result ... (3 Replies)
Discussion started by: shishir
3 Replies

8. Programming

equivalent of sprintf in C++

Hi My requirement is to convert the following to C++ char buffer; sprintf(buffer,"%s %-50s %6s %-6d %s\n",a.substr(0,5),a.substr(10,20)) Since the buffer is of varying length, i cannot hardcode the value as 90. i would like to convert the buffer to string object so that it can receive any... (1 Reply)
Discussion started by: dhanamurthy
1 Replies

9. UNIX for Dummies Questions & Answers

How to grep / zgrep to output ONLY the matching filename and line number?

Hi all, I am trying to zgrep / grep list of files so that it displays only the matching filename:line number and does not display the whole line, like: (echo "1.txt";echo "2.txt") | xargs zgrep -no STRING If I use -o option, it displays the matching STRING and if not used, displays the... (3 Replies)
Discussion started by: vvaidyan
3 Replies

10. Shell Programming and Scripting

Using Zgrep in a script

Hi, I have to use a zgrep in a script to serch archives. the issue is like if i use zgrep 'complex pattern' *.log.Z from the command line it works fine but inside the script i am not able to represent complex pattern the quotes are not getting recognised. Kindly help me out. Thanks,... (2 Replies)
Discussion started by: VijayPrakash
2 Replies
Login or Register to Ask a Question