When I use zgrep to search for multiple .gz files, the output contains the file name in it. Sometimes I don’t need it. Bcz I use some other scripts to analyze the output.
I tried using the -h option, but it does not work with zgrep.
This is how I use the command:
admin@mybox [11:16:56]> zgrep -Eh "\.ERR|\.WARNING|\.FATAL" messages.?.gz
messages.1.gz:Oct 14 10:02:06 .............................................
messages.2.gz:Oct 14 09:27:58 .............................................
Any idea how I can stop printing a file name?
source
share