Created
February 2, 2019 02:57
-
-
Save Maxopoly/6890af749c191a5c3bf6e2eb1b0a236a to your computer and use it in GitHub Desktop.
Search script for compressed logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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