LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 11-12-2005, 07:33 AM   #1
edgjerp
Member
 
Registered: Dec 2004
Location: Trondheim, Norway
Distribution: kubuntu 10.04
Posts: 308

Rep: Reputation: 31
kill extra shells


it seems that I have several copies of bash running, probably from earlier remote sessions. how can I figure out which ones are redundant? I do not want to kill the one responsible for my current login.
 
Old 11-12-2005, 09:42 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,820
Blog Entries: 15

Rep: Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664
Type "tty" on command line. It will show you which device you're currently on.

Then do "ps -ef |grep bash". You'll see all the bash shells running along with the tty's they're running on - the one that has the same tty (actually pseudo-tty) is the one you should avoid killing. Note that if they are sessions that didn't die they likely will have "?" in the tty column.

By the way for some reason "kill -1 <PID>" seems to work better for killing shells than just kill or kill -15 (and of course you should only use kill -9 as a last resort).

In future when you want to close a session in Linux type "exit" and hit return or hit Ctrl + D (Ctrl-D is defined as "exit" normally) rather than just closing the window from the little "x" in the upper right corner. This will prevent you having left over shells.
 
Old 11-12-2005, 10:26 AM   #3
edgjerp
Member
 
Registered: Dec 2004
Location: Trondheim, Norway
Distribution: kubuntu 10.04
Posts: 308

Original Poster
Rep: Reputation: 31
thanks. I got rid of a couple of extra shells, but still my system reports 12 users, but only 1 bash session (+ 1 for a root konsole) how can I tell my system to "clean" the utmp file? (without merging it with /dev/null)
 
  


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
What if 'kill -9' fails to kill a task? chii-chan Linux - Newbie 15 03-27-2013 04:47 PM
how to use kill to kill a batch of processes with same name? dr_zayus69 Linux - Software 2 09-03-2005 07:35 PM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 03:32 PM
help on the different shells... JoannesX Programming 2 02-06-2005 12:07 PM
do I need all the shells? helpme0904 Fedora 6 10-01-2004 03:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 04:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration