1

I would like dmesg to print human readable date times without passing the -T parameter. Is there a way to do this without setting up an alias? In config files maybe?

dmesg output:

# dmesg | tail -1
[    6.639729] IPv6: enp03: link becomes ready

in this case I would like dmesg to print:

# dmesg | tail -1
[Fri Sep 15 08:15:29 2017] IPv6: enp03: link becomes ready
imz -- Ivan Zakharyaschev
  • 4,921
  • 6
  • 53
  • 104
testfile
  • 2,145
  • 1
  • 12
  • 31

1 Answers1

7

I would like dmesg to print human readable date times without passing the -T parameter. Is there a way to do this without setting up an alias?

If you don't want an alias, which would usually be the best choice, you could place a script in a directory which is in PATH before /bin (if the real dmesg is /bin/dmesg), e. g. ~/bin/dmesg:

exec /bin/dmesg -T "$@"

Don't forget to chmod +x.

Armali
  • 18,255
  • 14
  • 57
  • 171