Andrew McCombe

Full Stack Web Developer

Grep Apache access log for browser and OS version

Today I’ve needed to find out if it was worth testing a client’s website with Safari 5 on Windows. Here’s some shell foo to find out from an access log

How to highlight keywords when using tail

How to highlight keywords when using tail Have you ever been tailing a log file looking for a specific keyword or phrase? Maybe you’re tailing an Exim log watching for an email, or an Apache log file for a specific request. Wouldn’t it be really great if you could highlight the keyword or phrase? Here’s […]

Rename files in bash

If you ever need to rename a batch of files using a regex or similar you can use the `rename` command: # Rename .wav to .mp3 rename -v ‘s/\.wav/\.mp3/g’ * # replace all hyphens in jpgs with a space rename -v ‘s/-/ /g’ *.jpg