Dies ist eine alte Version des Dokuments!
Linux Bash Commands
Grep in tar.gz (tgzgrep)
function tgzgrep { rm -R /tmp/tgzgrep > /dev/null; mkdir /tmp/tgzgrep; tar -C /tmp/tgzgrep -xzf $2; grep -i "$1" /tmp/tgzgrep/*; }
function mailgrep { rm -R /tmp/mailgrep; mkdir /tmp/mailgrep; tar -C /tmp/mailgrep -xzf 2013-03-20.mailarchive-in.tar.gz; grep -i "$@" /tmp/mailgrep/*; }
Check Postfix Maillog IPs with DNSBL
tac /var/log/mail.log | egrep "postfix-in(.*)client" | egrep -o "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -n 5 | while read line ; do ./check_dnsbl.sh -H $line ; done
Run command aganst reqursive filelist
find ./ -type f -print0 | while read -d $'\0' -r file ; do md5sum "$file" | grep --line-buffered --only-matching -m 1 '^[0-9a-f]*' | sort done
Functions in Bash
functionname() { echo $1 }