LinuxQuestions.org
Review your favorite Linux distribution.
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, 03:41 AM   #1
konzo
Member
 
Registered: Dec 2008
Location: Bulgaria
Distribution: Debian / Slackware / Ubuntu
Posts: 230

Rep: Reputation: 34
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, 03:56 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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, 04:00 AM   #3
rich_c
Member
 
Registered: Apr 2008
Location: UK
Distribution: PeppermintOS
Posts: 387
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, 04: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, 04:30 AM   #5
konzo
Member
 
Registered: Dec 2008
Location: Bulgaria
Distribution: Debian / Slackware / Ubuntu
Posts: 230

Original Poster
Rep: Reputation: 34
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, 04: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: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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, 04:51 AM   #7
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
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 11:10 AM
can you apply 2.6.x kernel config to 2.4.x safely/somewhat safely? silex_88 Linux - Software 3 12-09-2005 11:38 PM
how to use kill to kill a batch of processes with same name? dr_zayus69 Linux - Software 2 09-03-2005 06:35 PM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM
Error:Application gnome-panel(precess 3644) shams Linux - Software 0 04-16-2004 07:50 PM

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

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