LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 05-04-2009, 06:46 AM   #1
Azazwa
Member
 
Registered: Mar 2009
Distribution: Fedora 8, Ubuntu 9.10, SuSE 10, Fedora 14
Posts: 98

Rep: Reputation: 15
Killing the process on a virtual terminal from another virtual terminal.


Hi !

I used 'top' in a terminal, but it is not responding, and I can't seem to quit by using 'q'. I could open another virtual terminal (CTRL+ALT+F2)and log in as a different user, and I would like to kill the process in the other terminal, but I don't know how to get the pid of that terminal. Can I search for processes begun by a certain user? How do I do that?

Thanks!
 
Old 05-04-2009, 07:07 AM   #2
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,429
Blog Entries: 6

Rep: Reputation: 51
ps -auxf | grep "<processname>
 
Old 05-04-2009, 08:17 AM   #3
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux
Posts: 1,012

Rep: Reputation: 93
Why worry about the pid? Just enter "killall top" (without quotes).
 
Old 05-04-2009, 08:37 AM   #4
Azazwa
Member
 
Registered: Mar 2009
Distribution: Fedora 8, Ubuntu 9.10, SuSE 10, Fedora 14
Posts: 98

Original Poster
Rep: Reputation: 15
Hi!

I used (as root) ps -u user1 to get the pid's of the processes run by the user1, which I thought included the top process that seems to "hang". When I went back to the first virtual terminal, it didn't change anything. It's still hanging. Then I saw mark afred's reply, and tried "killall top", but it says "top: no process killed". I wanted to check files that I copied over with the network, so (as root) I tried "cd /", and then "ls", but now it hangs at the "ls" part, and doesn't give anything. I'm now as root on the third virtual terminal, but I'm afraid of running out of terminals, so to speak. I don't know what's going on.

Anyone got an idea?
 
Old 05-04-2009, 10:23 AM   #5
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux
Posts: 1,012

Rep: Reputation: 93
Maybe "killall -u user1", which should kill all processes being run by user1, or "killall -u user1 top" to specifically kill the process of top being run by that user.

Rebooting often works, if all else fails.

Additional thought:
When you say "virtual terminal" are you in xwindows, using a terminal emulator like gnome-terminal or xterm? Perhaps pressing Ctrl-Alt-F2 (the three keys in combination), and opening a new terminal, signing in as user1, rather than as a different user as your first post pondered, and then killing the process from there, might work.

Last edited by mark_alfred; 05-04-2009 at 10:32 AM. Reason: an additional thought
 
Old 05-04-2009, 11:00 AM   #6
ozminh
Member
 
Registered: Aug 2007
Posts: 73

Rep: Reputation: 19
i'll kill them all ('kill -9 -1').
 
Old 05-05-2009, 04:37 AM   #7
Azazwa
Member
 
Registered: Mar 2009
Distribution: Fedora 8, Ubuntu 9.10, SuSE 10, Fedora 14
Posts: 98

Original Poster
Rep: Reputation: 15
Thanks everyone!

I'm also thinking that that specific user that I was trying to log in as on the node doesn't yet exist on the node, although it is very queer in and of itself, but I won't go into the detail of that.

However there was a 1 second power-cut late yesterday afternoon, so for now, I'll worry about the login problems at a later stage.

:-)
 
Old 05-05-2009, 06:55 AM   #8
Azazwa
Member
 
Registered: Mar 2009
Distribution: Fedora 8, Ubuntu 9.10, SuSE 10, Fedora 14
Posts: 98

Original Poster
Rep: Reputation: 15
Oh, may I say, I tested your advice with another problem.
I pinged another host without using "-c1" and I didn't know how to stop it, so I used the ps -auxf | grep <processname> and kill "pid" which was 9256 or something from another terminal (CTRL+ALT+F2), but I guess it could also just have been killall ping.
Thanks!
 
Old 05-05-2009, 12:33 PM   #9
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,178

Rep: Reputation: 49
Remember that you can (almost) always also use Ctl-C to stop commands (especially useful in the cases such as ping).
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Killing a process through terminal. urbansaint Linux - Newbie 2 05-20-2008 10:56 PM
process in different virtual terminal krymsunmortis Linux - General 3 01-17-2008 11:10 PM
virtual terminal deity46 Fedora 2 06-07-2005 08:39 PM
Virtual terminal blackzone Linux - General 4 07-22-2004 06:13 AM
Only one virtual terminal? kule Slackware 7 07-14-2004 05:06 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration