LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 08-02-2012, 07:37 AM   #1
puntino
Member
 
Registered: Sep 2006
Location: Italy
Distribution: Suse 10.1
Posts: 78

Rep: Reputation: 15
How to unload kernel module


Hello,
I need to unload a kernel module which has a very long name (stap8983664890.....).
The command that I should use is modprobe -r <kernel_module_name>
in my case, the name of the module is very long (and includes random characters). It is impossible to type all the characters because it takes time and it's error prone.
I tried with
modprobe -r | lsmod | grep "stap*"
(the name starts with "stap") but it didn't work.
Thank you in advance.
 
Old 08-02-2012, 08:20 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can try the following:
Code:
rmmod $(lsmod |grep stap* |awk '{print $1}')
Regards
 
Old 08-02-2012, 08:47 AM   #3
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
grep doesn't use wildcards (at least, by default). That's why
grep "stap*"
won't work, unless * is part of the module name.
 
Old 08-07-2012, 06:11 AM   #4
puntino
Member
 
Registered: Sep 2006
Location: Italy
Distribution: Suse 10.1
Posts: 78

Original Poster
Rep: Reputation: 15
Thank you, it worked after removing the "*" character
 
  


Reply



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
system call to load and unload the module in kernel sharad Linux - Kernel 3 03-01-2007 05:00 AM
Better way to load/unload a kernel module seran Linux - General 3 06-23-2006 08:19 AM
Rapid module load/unload = Kernel panic mclerand Linux - Kernel 0 05-06-2006 11:02 AM
how to unload kernel module dynamically kushneeraj Programming 1 10-26-2005 11:46 PM
Unable to unload eepro100 module in Kernel 2.6 simjii Linux - General 0 12-08-2003 11:50 PM

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

All times are GMT -5. The time now is 03:44 PM.

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