Skip to content

Instantly share code, notes, and snippets.

@Maxopoly
Created February 2, 2019 02:57
Show Gist options
  • Save Maxopoly/6890af749c191a5c3bf6e2eb1b0a236a to your computer and use it in GitHub Desktop.
Save Maxopoly/6890af749c191a5c3bf6e2eb1b0a236a to your computer and use it in GitHub Desktop.
Search script for compressed logs
#!/bin/bash
#Sorting will automatically sort the retrieved entries chronologically for minecraft logs,
#because the output of zgrep will be prefixed with the name of the file, which starts with a timestamp
find -name \*.log.gz -print0 | xargs -0 zgrep "$1" | sort
grep "$1" latest.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment