Archive for October, 2015

One line helpers

# Analyze all but INSERTS from mysql’s general log grep -E ‘^.*[0-9]{1,}\sQuery’ /your-path/to/file.log | awk ‘{$1=$2=””; print toupper($0)}’ | sed ‘s/\s+/ /g’ | grep -Ev “^\s*INSERT” | sed -r ‘s/^(.*)(\sSET\s).*(\sWHERE.*)/\1\3/g’ | sed -r ‘s/^(.*SELECT).*(\sFROM)(\s.*)/\1\3/g’ | sed “s/’//g” | sed -r ‘s/=\s\w+/ /g’ | sort | uniq -c # Change ls result and execute it. ls […]

Read more...