Tuesday, September 26, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  28] [ 0]  / answers: 1 / hits: 45307  / 1 Year ago, mon, october 17, 2022, 11:22:26

When I connect a USB drive to an Ubuntu OS, would there be a text file which contains details of that connection and if so, where is that file located ? What is the name of that file?

More From » usb


Does Ubuntu log when USB devices are connected?

Yes, Ubuntu logs when a USB device is connected. The file is /var/log/syslog. You can also view it by issuing the command dmesg (with optional -c argument to clear the log) or graphically using Log file viewer.

Is this file deleted upon shutdown?

No, This log does not get wiped upon shutdown. After a size limit is reached the logs are rotated, meaning new logs are continually written to /var/log/syslog while older records are pushed to compressed files named /var/log/syslog.1.gz, syslog.2.gz, ... in the same /var/log directory.

You can view the /var/log directory with rotated log files below:

enter image description here

[#38118] Tuesday, October 18, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 10
Total Questions: 113
Total Answers: 117

Location: Burundi
Member since Sat, Aug 21, 2021
2 Years ago