Open Source Development

Power Open Source Development

Connect, learn, share, and engage with IBM Power.


#Power


#Power
 View Only
  • 1.  Need similar tool of zgrep in aix server

    Posted Tue July 29, 2025 08:49 AM

    On many systems, there is a tool called zgrep which is used to grep content from compressed files. Is there any similar tool available on AIX? My purpose is to grep a particular word from multiple compressed files and display the filenames that contain that word on an AIX server. Could you suggest the best RPM package or another command to solve this issue?



    ------------------------------
    Vivek M
    ------------------------------

    #AIXOpenSource


  • 2.  RE: Need similar tool of zgrep in aix server

    Posted Tue July 29, 2025 08:59 AM

    You can install gzip rpm from AIX Toolbox and get the zgrep tool. 



    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: Need similar tool of zgrep in aix server

    Posted Wed July 30, 2025 01:59 AM

    Hi Ayappan,

    I have already installed the gzip package but no use , nothing is working 



    ------------------------------
    Vivek M
    ------------------------------



  • 4.  RE: Need similar tool of zgrep in aix server

    Posted Wed July 30, 2025 02:00 AM

    Can you explain more on why zgrep from gzip rpm is not working ? What is the error/problem you are facing ?



    ------------------------------
    Ayappan P
    ------------------------------



  • 5.  RE: Need similar tool of zgrep in aix server

    Posted Wed July 30, 2025 02:30 AM

    By using gzip -dc [FILE] | grep -i [STRING] This command is useful to grep the word from all compressed files only, but my query is different. I want to grep and display the list of file names that contain the word from all compressed files. I tried to used zgrep but i am getting this error

    # zgrep 'fnsrr' *.gz
    ksh: zgrep:  not found.



    ------------------------------
    Vivek M
    ------------------------------



  • 6.  RE: Need similar tool of zgrep in aix server

    Posted Wed July 30, 2025 02:36 AM

    Share the below o/p's., 
    rpm -qa | grep gzip 
    rpm -ql gzip | grep zgrep 
    echo $PATH



    ------------------------------
    Ayappan P
    ------------------------------



  • 7.  RE: Need similar tool of zgrep in aix server

    Posted Wed July 30, 2025 02:49 AM

    # rpm -qa | grep gzip
    gzip-1.12-3.ppc


    # rpm -ql gzip | grep zgrep
    /opt/freeware/bin/zgrep
    /opt/freeware/bin/zgrep_32
    /opt/freeware/bin/zgrep_64
    /opt/freeware/man/man1/zgrep.1

    # echo $PATH
    /usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java8_64/jre/bin:/usr/java8_64/bin:/usr/local/bin



    ------------------------------
    Vivek M
    ------------------------------



  • 8.  RE: Need similar tool of zgrep in aix server
    Best Answer

    Posted Wed July 30, 2025 04:47 AM

    Yes now working fine. What i understood is need to give full path or need to export the path before execute the command.

    export PATH=/opt/freeware/bin:$PATH

    or else we can use below full path command

    /opt/freeware/bin/zgrep -il {string) *.gz



    ------------------------------
    Vivek M
    ------------------------------