Quantcast
Channel: bash – Wayno's Adventures and Sojourns through Linux
Viewing all articles
Browse latest Browse all 11

How to add user comments to the Linux system log

$
0
0

So how do you add a comment to the system log?

It turned out to be MUCH easier then I thought.

Why would you want to do this? Maybe you added a new driver, or new hardware, and you need to identify when you did that. This is a handy way to note that.


logger
This is a test
ctrl d

ctrl d — means to HOLD and PRESS the ctrl key and the d key at the same time. Control + d is the Linux end-of-file. (NOT control+ z, like it is in Windows)

That would log: “This is a test” to the system log.

To display the log entries, I tail(ed) (see man entry on tail)
the output of the system log (/var/log/messages) and then piped that (the output of the cat, is the input to grep), and said hey find entries with just my userid.


sudo tail -150 /var/log/messages | grep nwayno

You should get back:

Jul 26 20:18:09 Homer nwayno: this is a test.

I also figured out how to add videos to a Sansa Fuse Mp3/Video player. Hope to have that up, tomorrow.

Wayno


Viewing all articles
Browse latest Browse all 11

Trending Articles