Showing posts with label zdiff and zgrep.. Show all posts
Showing posts with label zdiff and zgrep.. Show all posts

Sunday, May 17, 2020

zcat, zless, zdiff and zgrep.

When working with compressed files, many standard commands cannot be used directly. For many commonly-used file and text manipulation programs, there is also a version especially designed to work directly with compressed files. These associated utilities have the letter "z" prefixed to their name. For example, we have utility programs such as zcatzlesszdiff and zgrep.

Here is a table listing some z family commands:

CommandDescription
$ zcat compressed-file.txt.gzTo view a compressed file
$ zless somefile.gz or $ zmore somefile.gzTo page through a compressed file
$ zgrep -i less somefile.gzTo search inside a compressed file
$ zdiff file1.txt.gz file2.txt.gzTo compare two compressed files

Note that if you run zless on an uncompressed file, it will still work and ignore the decompression stage. There are also equivalent utility programs for other compression methods besides gzip.

Featured Post

Managing CA Certificates on Red Hat Linux 9: Understanding update-ca-trust extract

  Managing CA Certificates on RHEL9 RHEL8 OracleLinux9 OracleLinux8 In today's digital landscape, securing communications and verifying ...