Skip to content

Instantly share code, notes, and snippets.

@greyaperez
Created December 16, 2013 17:04
Show Gist options
  • Save greyaperez/7990423 to your computer and use it in GitHub Desktop.
Save greyaperez/7990423 to your computer and use it in GitHub Desktop.
Logging - with filtering
# Tail Files in Directory
# USAGE: $ log {arg1:file filter(opt)} {arg2:string filter(opt)}
function log (){
if [ $# -lt 1 ];
then
tail -f *
fi
if [ $# -gt 1 ];
then
tail -f $1 | grep --line-buffered "$2"
else
tail -f $1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment