
/tar-56a763365f9b58b7d0ea0473.png)

zdiff: diff to see the difference between two compressed filesĭon't worry too much.zless for less, zmore for more: to view the file in pages.zgrep: grep to search inside the compressed file.These Z commands provide a ‘Z’ equivalent to regular file manipulation commands. They work directly on compressed files.Īctually, it does kind of extract it temporarily in /tmp, but that’s not the same as an actual extraction, is it? Not many people are aware of the powerful 'Z commands' that work on the gzipped files without you needing to extract them first. Use Z commands! Dealing with Gzip compressed files without extracting them You extract all the required files one by one, analyze them and then remove the extracted files when you don't need them anymore. Viewing Gzip file with normal `cat` commandīut extracting the compressed log files first and then analyzing them takes more time and disk space. Why? Unlike regular text files, where you can use the cat command to viewcontent of the file or use grep command on it or use less to read the content without flooding your screen, compressed files cannot be used with the same regular Linux commands. gz log files first and then use cat, less, grep etc commands to read and analyze the logs. If you are investigating some issue and you have to deal with gzip compressed logs, the normal workflow is to extract the. On Linux servers, logs are often compressed in gzip format to save disk space.
