Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-23-2010, 03:41 AM   #1
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
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
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
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
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
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

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,

1 members found this post helpful.
Old 01-23-2010, 04:51 AM   #7
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.
1 members found this post helpful.


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:03 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration