extract table names from sql log file
grep "from " /var/log/mysql/mysqld.log | awk -Ffrom '{print $2}' | awk '{print $1}' | cat > /home/shantanu/testing.txt
12361 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
grep "from " /var/log/mysql/mysqld.log | awk -Ffrom '{print $2}' | awk '{print $1}' | cat > /home/shantanu/testing.txt
grep '\[Spam score: [1-9]' /var/log/exim/main.log | awk '{print $3}' | xargs -t -i grep {} /var/log/exim/main.log > /var/log/exim/spam_score.log
grep 'reporter\.pl' /var/log/exim/main.log | awk '{print $3}' | xargs -t -i grep {} /var/log/exim/main.log > /var/log/exim/spam_reporter.pl.log
# Show a list of actions sorted by time taken. Useful for finding slow actions. cat log/development.log | awk '/Completed/ { print "[" $3 "] - " $0 }' | sort -nr
history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
mysql -uroot -D sfcnet_development -e "show table status\G"| egrep "(Index|Data)_length" | awk 'BEGIN { rsum = 0 } { rsum += $2 } END { print rsum }'
BEGIN {s=""; FS="n"} /<td/ { gsub(/<[^>]*>/, ""); s=(s ", " $1);} /<tr|<TR/ { print s; s="" }
cat $@ | awk '{ print length, $0 }' | sort -n | awk '{$1=""; print $0}'
nawk -Fc '{print $1}' test.txt
nawk -F: '{print $2}' test.txt
cd /usr/local/scratch/ mkdir junk find /var/spool/postfix -exec grep "somediscernible-feature.com" '{}' \; | awk '{print($3)}' | xargs -J X mv X ./junk/
Binary file /var/spool/postfix/active/D/D8832E38 matches Binary file /var/spool/postfix/active/D/D78EC1C72 matches Binary file /var/spool/postfix/active/D/D593D279D matches Binary file /var/spool/postfix/active/D/D0EB32833 matches
/var/spool/postfix/active/D/D8832E38 /var/spool/postfix/active/D/D78EC1C72 /var/spool/postfix/active/D/D593D279D /var/spool/postfix/active/D/D0EB32833