Skip to content

Instantly share code, notes, and snippets.

@sasrai
Created July 17, 2019 16:42
Show Gist options
  • Save sasrai/0f1ffdca9868be74a2f96c474023aa8f to your computer and use it in GitHub Desktop.
Save sasrai/0f1ffdca9868be74a2f96c474023aa8f to your computer and use it in GitHub Desktop.
Ubuntuのdmesg自動更新表示スクリプト
#!/bin/sh
while true
do clear
date
esc=$(printf '\033')
dmesg --color=always --time-format iso | grep -vE "(cbr0|IPv6|audit|promiscuous mode)" | tail -15 | sed "s/,[0-9]\{6\}+0900 / /g" | sed "s/^[^ ]*\([0-9]\{4\}-[01][0-9]-[0-3][0-9]\)T\([^ ]\+\) /${esc}[32m[\1 \2] /g"
sleep 15
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment