linux - 在 SunOS 中使用哪个命令相当于 linux 中的 zgrep

标签 linux bash

<分区>

尝试在 *.gz 文件中查找字符串并尝试以下操作;

   zipgrep user >filename>.gz 
     [<filename>.gz]
     End-of-central-directory signature not found.  Either this file is not
     a zipfile, or it constitutes one disk of a multi-part archive.  In the
     latter case the central directory and zipfile comment will be found on
     the last disk(s) of this archive.
     zipinfo:  cannot find zipfile directory in one of <filename>.gz or
      010414:22:59.serverlog.gz.zip, and cannot find <filename>.gz.ZIP, period.
      /usr/bin/zipgrep: test: argument expected

zgrep is not available;
 zgrep -h
      -bash: zgrep: command not found

感谢您的帮助。

最佳答案

I tried zcat also but it is giving me this error; .gz |grep -i user-user

这表明你正在做这样的事情:

zcat '<filename>.gz |grep -i user-user <filename.serverlog.gz.Z'

你想要这个:

zcat filename.gz | grep -i user-user

关于linux - 在 SunOS 中使用哪个命令相当于 linux 中的 zgrep,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21242132/

相关文章:

linux - cloudlinux 中的 Incron 功能

bash - 查找并删除具有相同前缀但不同扩展名的文件(即 *.flac 和 *.mp3)

xml - 转换仅包含特定标签的 xml

bash - 需要帮助使用 sed 编辑文件

linux - su 在脚本中将其重定向到 super 用户目录

arrays - 有没有办法在 Bash 中将一个字符串数组拆分为多个其他数组?

在运行时检查 Linux 内核配置

java - 无法将 Java 客户端连接到 C 服务器

java - 从客户端访问远程Linux系统中的文件夹并在客户端浏览器上显示文档

linux - 如何导入SSH私钥?