YEARONE
..
saved the registers. lost the operator.
<< home
[ CODE ]
[ TOOLS ]
[ MUSIC ]
[ PICTURES ]
[ C O D E ]
07.10.2026 · 2 min
TITLE
..........
Five one-liners for log diving
DATE
..........
07.10.2026
TAGS
..........
bash, awk, logs
SIZE
..........
2 min
Nothing fancy, just the five commands that end up in my shell history every week.
[ ~/bin/logdive.sh ]
shell · 5L
1
$
awk
'{print $1}' access.log
|
sort
|
uniq
-c
|
sort
-rn
|
head
2
$
grep
' 404 ' access.log
|
awk '{print $7}'
|
sort
|
uniq
-c
|
sort
-rn
3
$
tail
-f
access.log
|
grep
--line-buffered -v
'bot'
4
$
awk
'$NF > 1.0' access.log
|
wc
-l
5
$
zcat
access.log.*.gz
|
grep
-c
'wp-login'
-- READ ONLY -- utf-8 · shell · 5 lines
[copy]
[wrap]
$ awk '{print $1}' access.log | sort | uniq -c | sort -rn | head $ grep ' 404 ' access.log | awk '{print $7}' | sort | uniq -c | sort -rn $ tail -f access.log | grep --line-buffered -v 'bot' $ awk '$NF > 1.0' access.log | wc -l $ zcat access.log.*.gz | grep -c 'wp-login'
<< back to code
-= eof =-
(c) 2026 yearone.cloud · root@yearone.cloud