Skip to content

Instantly share code, notes, and snippets.

@fabiolimace
Created February 14, 2025 18:54
Show Gist options
  • Save fabiolimace/f631a8fc96e067586438911a20a40ed4 to your computer and use it in GitHub Desktop.
Save fabiolimace/f631a8fc96e067586438911a20a40ed4 to your computer and use it in GitHub Desktop.
Gzip tools like zcat
#!/bin/sh
zcat "$1" | less
#!/bin/sh
for file in "$@"; do echo -e "$(zcat "$file" | wc) $file"; done;
@fabiolimace
Copy link
Author

fabiolimace commented Feb 14, 2025

Examples:

zless file.txt.gz
zwc file1.txt.gz file2.txt.gz file3.txt.gz

Notes:

  • Some distributions already have zless.
  • On Alpine Linux, add the gzip package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment