Can I view the history of connected usb?

7,164

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

dmesg | grep usb
Share:
7,164

Related videos on Youtube

Stallman
Author by

Stallman

Familiar only with C currently. Not abundant experiences in JAVA and C++. New beginner to Html V(Javascript+CSS+HTML)/Python and Bash. However, I have great interest in computer science knowledge like programming language, image processing, networking, software engineering... Since I don't study in computer science department, hoping experienced programmer can give me advice that how to become stronger in this domain.

Updated on September 18, 2022

Comments

  • Stallman
    Stallman over 1 year

    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?

  • Rémi
    Rémi almost 10 years
    '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.
  • Stallman
    Stallman almost 10 years
    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!!
  • desgua
    desgua almost 8 years
    For future reference: you can see "older" dmesg files at /var/log/