LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-07-2017, 04:45 PM   #1
Waris
Member
 
Registered: May 2017
Distribution: Centos 6,7 and Windows
Posts: 40

Rep: Reputation: Disabled
Question Centos 7 THUMB drive log?


Hey all,

which/where log file does cantos 7 log when you plug in a writable USB drive into it? I mainly want to see what it says in the log file when you plug in a Thumb drive. Writable thumb drive. not plugging in a mouse or key board usb cables but thumb drives.

Thanks a mill!


Also, to the admins of this page. I am sorry if i have created this thread in the wrong place. I am a newbie. I am trying to do better
Thanks for your patience.
 
Old 06-07-2017, 06:42 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,719

Rep: Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550
systemd use journalctl - but you can still just use dmesg and parse that if you wish.
 
Old 06-08-2017, 10:19 PM   #3
Waris
Member
 
Registered: May 2017
Distribution: Centos 6,7 and Windows
Posts: 40

Original Poster
Rep: Reputation: Disabled
Thanks for the reply!

I am actually trying to find a script or write one that shows a thumb drive. When i inserted a Thumb drive it lists it in dmesg and also /var/log/message. When i view
the devices listed using the command dmesg | grep usb, it gives a lot of info to the connected device. would you happen to know a script that tells me a thumb drive is inserted using the log from /var/log/message?
 
Old 06-09-2017, 01:03 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,863

Rep: Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598
You could probably use https://linux.die.net/man/1/inotifywatch or possibly https://linux.die.net/man/8/logwatch or write your own...
In very crude terms:
Code:
tail -f somelog.log |grep <blah>| do-something_here
I have done it using Perl + http://search.cpan.org/~mgrabnar/File-Tail-1.3/Tail.pm

HTH
 
Old 06-09-2017, 01:03 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,719

Rep: Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550
Should be as simple as being more specific with your grep. Maybe look at the context controls to ensure you have sufficient info - only you can decide if that is also required.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dd to copy a thumb drive which I am live booted on to another thumb drive DrinkinHomeBrew Linux - Newbie 3 01-26-2015 04:52 PM
LXer: Create a Bootable Live USB Thumb Drive or Rescue Drive Using UNetbootin LXer Syndicated Linux News 0 08-06-2012 03:10 AM
Using a usb thumb drive or flash drive as a swap partition. stevenjoseph Linux - Hardware 8 01-16-2012 12:09 PM
Install Linux to SATA drive but GRUB2 on to USB thumb drive Quija Linux - General 2 11-22-2011 06:40 PM
CentOS 4.3 will not use a USB thumb-drive on a Dell Optiplex GX240 Freehand Linux - Hardware 3 09-25-2006 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration