LinuxQuestions.org
Register a domain and help support LQ
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 01-23-2010, 04:41 AM   #1
konzo
Member
 
Registered: Dec 2008
Location: Bulgaria
Distribution: Debian / Slackware / Ubuntu
Posts: 230

Rep: Reputation: 33
Safely kill precess


I have simple question.

I am reading some documents with various programs e.g. more, less, cat...

When type ps it appear that they stay in the memory.

Is it safely to kill them or even kill -9, when they continue to stay in memory?
 
Old 01-23-2010, 04:56 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,387
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
It is okay to kill anything that doesn't make changes to files, such as the programs you mentioned. However, they should be exiting by themselves...
 
Old 01-23-2010, 05:00 AM   #3
rich_c
Member
 
Registered: Apr 2008
Location: UK
Distribution: Mepis; Maemo; openSUSE
Posts: 384
Blog Entries: 74

Rep: Reputation: 81
What's the 'kindest' way of using kill? I'd like to be able to stop and restart apps remotely. As they'd be apps that are running OK in the first place, a way of letting them exit gracefully would be good.
 
Old 01-23-2010, 05:02 AM   #4
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
How do you kill the process. I use htop to kill a process. Then there is the long way of using ps -e and then looking at the id and then killing the process.
However a process once killed should stop running after a few seconds.
 
Old 01-23-2010, 05:30 AM   #5
konzo
Member
 
Registered: Dec 2008
Location: Bulgaria
Distribution: Debian / Slackware / Ubuntu
Posts: 230

Original Poster
Rep: Reputation: 33
I type ps and then kill with the PID number as argument.

How must I exit from less, cat and other tools for viewing. I use ctrl+z. Is that ok?
 
Old 01-23-2010, 05:44 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

There's your problem, right there! CTRL-Z sends the process to the background, it doesn't terminate it. To stop processes like more, less, and so on, just type q to 'quit'. That's all.

Kind regards,

Eric
 
1 members found this post helpful.
Old 01-23-2010, 05:51 AM   #7
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
Also for the usage of kill. I found this nice little link that gives an nice of example of how to kill and when to use more extreme kill methods.

http://speculation.org/garrick/kill-9.html
 
1 members found this post helpful.
  


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
[SOLVED] Kill a hung task when kill -9 doesn't help 10110111 Linux - General 4 04-02-2009 12:10 PM
can you apply 2.6.x kernel config to 2.4.x safely/somewhat safely? silex_88 Linux - Software 3 12-10-2005 12:38 AM
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
Error:Application gnome-panel(precess 3644) shams Linux - Software 0 04-16-2004 08:50 PM


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