LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 08: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, 09:20 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,214
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
Hi,

You can try the following:
Code:
rmmod $(lsmod |grep stap* |awk '{print $1}')
Regards
 
Old 08-02-2012, 09: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, 07: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


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

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

All times are GMT -5. The time now is 12:16 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