Skip to main content

How can I set the default time format for dmesg? [Resolved]

I use dmesg in Ubuntu heavily. I like the iso time format but I hate typing it out every time, so I use something like this in my .bashrc to set the default time format for dmesg:

# Setup alias for dmesg
alias dmesg="/bin/dmesg --time-format=iso"

Is there a better/proper way of doing this? Per user or globally, I don't care.

Question Credit: dgreene
Question Reference
Asked August 18, 2019
Tags: ubuntu, dmesg
Posted Under: Network
1 Answers

dmesg doesn't have a configuration file, so the only way to change its behavior is via command line options. As such, the way you're doing this is just fine.

credit: Matt Zimmerman
Answered August 18, 2019
Your Answer