Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to know what USB devices had connected to my Ubuntu 12.04 PC. I've read this but I didn't get satisfied since i dont know how to deal with the log file to collect the data I need.

Also, I want to search for old connected USBs not during real time.

That is, I want a tool or any way that manage and monitor which USBs is connected to my PC.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

There is another way to see all USB devices in Ubuntu using command Line. It is hwinfo.

If you don't have it, install it with sudo apt-get install hwinfo, or Using software center by clicking on the link bellow:

Install via the software center

After installation, to see all USB devices with necessary info , use sudo hwinfo --usb. It will give you detail information about all USB devices in your system. You may want to save it in a text file using redirecting feature, such as sudo hwinfo --usb > usb-info.

There will be a file in current directory with name usb-info containing all information of USB devices.

manpage for the hwinfo command Manpage icon

Real time monitoring of the log:

For real-time monitoring of the log, you can use tail command, which shows the last fews lines of a file.

To do so, open a terminal and execute this command

 tail -n15 -f /var/log/syslog

This will show you last 15 lines in the log file. Change the number of lines in the option if you need. Now try inserting a USB device and removing it. The terminal will show you the messages. When you want to exit, just press Ctrl+C keyboard shortcut.

See the tail manual here for more info → manpage for the tail command Manpage icon

share|improve this answer
1  
It still real time monitoring... I need more –  user61928 Sep 10 '12 at 15:40
1  
I think you need monitoring while happening, which is actually real time monitoring –  Anwar Shah Sep 10 '12 at 15:44
    
@maythux see my updated answer –  Anwar Shah Sep 10 '12 at 17:50
add comment

lsusb should give you a good idea.

There are variants on that (like adding the -v flag to that) or alternative that do roughly the same job like sudo lshw which covers all hardware.

share|improve this answer
2  
Or you can get a tree view of the devices with lsusb -t command –  Anwar Shah Sep 10 '12 at 14:45
1  
lsusb is a utility for displaying information about USB buses in the system and the devices connected to them. This is from man page of lsusb...This means that lsusb tracks USB devices that are connected while i need more than real time monitoring. –  user61928 Sep 10 '12 at 15:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.