Loading ...

What's your function in life?

Ours is writing random blog articles about web development, TYPO3 and more.

Random useful commands

Create Database (MySQL) in 2019 - with emoji support 🤩

CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Access log parsing

# per URL
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' | sed 's/\?.*//g' | sort | uniq -c | sort -rn

 

# per Status Code
cat access.log | cut -d '"' -f3 | cut -d ' ' -f2 | sort | uniq -c | sort -rn

 

# find URLs with status code (404)
awk '($9 ~ /404/)' access.log | awk '{print $7}' | sort | uniq -c | sort -rn

Comments

No comments

Write comment

* These fields are required