LinuxQuestions.org
Help answer threads with 0 replies.
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 04-28-2005, 10:28 AM   #1
paraiso
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 88

Rep: Reputation: 15
Question Find processes


Hello!

What would be the command to find processes which are not associated with any terminal ??

Cheers
 
Old 04-28-2005, 10:54 AM   #2
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
for eg.
Code:
ps aux
Code:
man ps # will tell you more
 
Old 04-28-2005, 01:42 PM   #3
spariggio82
Member
 
Registered: Apr 2004
Location: Camporotondo Etneo, Sicily
Distribution: SuSE 8.2 SuSE 9.1 Fedora C1 Slackware 10.1 Knoppix 3.9
Posts: 174

Rep: Reputation: 30
try using

ps -aux |grep <processname>

or

top
 
Old 04-28-2005, 01:57 PM   #4
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 14.2 Solus
Posts: 2,264

Rep: Reputation: 51
top
 
Old 04-28-2005, 02:44 PM   #5
paraiso
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 88

Original Poster
Rep: Reputation: 15
Does the command top is enough to find all the processes not associated with any terminal ?
 
Old 04-28-2005, 02:47 PM   #6
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
top wont care on that matter.

"ps aux" will list every process running on the system to stout, thenm you can modify the results as thy wish.
 
Old 04-28-2005, 03:14 PM   #7
paraiso
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 88

Original Poster
Rep: Reputation: 15
Kiitti Artanicus ! How would you get the processes which are not associated with any terminal and kills them. I mean ps -aux displays all the processes but how can I first display only the ones not associated with any terminals and then kill them ? I need probably to pipe grep with ps -aux but then I don't know
 
Old 04-28-2005, 03:23 PM   #8
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
well, at first, if you would kill every process not associated with a terminal, your machine would go down within nanoseconds. There are alot of importat processes running that arnt associated with a terminal.

Piping isnt realy that hard, just takes a tad of imagination.. (;

for eg:
Code:
kill $(ps aux | grep pr[o]gram | cut -d " " -f 6)
explained shortly:
$(command) # is replaced with the output of the command
| grep pr[o]gram # will search for the process we want. one letter in [] to acoid the grep we just made to be caught
| cut -d " " -f 6 # we cut the output, preserving only the 6th field, where fields are seperated by a space.
 
Old 04-28-2005, 03:38 PM   #9
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 14.2 Solus
Posts: 2,264

Rep: Reputation: 51
I wouldn't recommend that you just start randomly killing processes without knowing what those processes are.

Most of the junk can be disabled by editing or diabling startup scripts to prvent them from loading in the first place.
 
Old 04-28-2005, 04:36 PM   #10
paraiso
Member
 
Registered: Apr 2005
Distribution: Fedora Core 4
Posts: 88

Original Poster
Rep: Reputation: 15
Could it work with:

Code:
kill $(ps -axuf | grep -v tty[1-6] | grep -v pts)
 
  


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
linux find to find files with multiple patterns subu_s Programming 6 12-15-2010 01:15 AM
Can`t find C-compiler in Debian ,or at least can`t find one that can make executables hemmelig Linux - Software 4 05-26-2008 04:07 AM
monitoring active processes and identifying the required processes. gajaykrishnan Programming 2 08-13-2004 02:58 AM
Too many processes? mooreted Linux - Software 2 04-05-2004 04:27 PM
how to find CPU and IO bound processes tuxrhl Linux - General 0 11-22-2003 02:11 AM

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

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