I don't know Ubuntu or other linux distribution would record the connected USB

information or not. I mean does Ubuntu record the USB information as I plug it into the PC,

when I plug it out, does the record remains in system? If yes, where is the log?

If not, can I do this?

1 Answer 1


You can get something by using the dmesg command and filter it to only keep USB events.

dmesg | grep usb
  • Well, thanks, it does shows my connection history. But how can I clear that?
    – Stallman
    May 5, 2014 at 10:02
  • 'dmesg' displays the buffer of messages from the kernel (not only about usb). You can clear the buffer with 'dmesg -c'. But if you plan to do this from a program, you can also memorize the timestamp of the last message and only keep what is after.
    – Rémi
    May 5, 2014 at 10:48
  • How to clean msg after certain timestamp? I want to know the command, and could you also provide me the doc(relevant sites) about the usage of this command? Thanks!!
    – Stallman
    May 6, 2014 at 10:18
  • For future reference: you can see "older" dmesg files at /var/log/
    – desgua
    Jul 26, 2016 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .