LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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


Closed Thread
  Search this Thread
Old 03-06-2008, 11:00 PM   #1
jianelisj
LQ Newbie
 
Registered: Mar 2008
Posts: 18

Rep: Reputation: 0
sort active processes and show every process once


I would like to help me in the following problem:

i have to construct a sorted (by size) list of active processes in Minix. If a process is being executed more than once then its name must be only one time in the list. Finally i have to present the list in a "formatted" way.

Than you in advance
 
Old 03-06-2008, 11:23 PM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Are we expected to do your home/coursework for you? This is the second thread of this nature you have posted. A little self help wouldn't go amiss. Try using google to find the answers first before posting a request for help.
 
Old 03-06-2008, 11:32 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
OP has now posted 3 homework questions...This is what I posted in the other 2 threads:

Homework!!
The best way to get homework help here is to show us what you have tried.
 
Old 03-06-2008, 11:39 PM   #4
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Did the OP think we wouldn't realise.
 
Old 03-07-2008, 07:09 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by {BBI}Nexus{BBI} View Post
Did the OP think we wouldn't realise.
Homework trolls don't think---some don't even have a brain.
We are breeding a whole new class of people in the world--characterized by ambition for advancement without any accompanying willingness to work or learn. They care only about securing a job and not about actually learning anything--much less contributing to society.

Don't get me started!!!----no, wait!...you already did.....
Never mind....
 
Old 03-07-2008, 08:11 AM   #6
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Rep: Reputation: 30
I had a professor who was asked to teach a course on Linux (well it touched on the subject for 6 weeks) and had to ask in these very forums for the proper way to do things so he knew how to properly grade homework assignments. WOW interesting course that was.
 
Old 03-07-2008, 08:56 AM   #7
jianelisj
LQ Newbie
 
Registered: Mar 2008
Posts: 18

Original Poster
Rep: Reputation: 0
sort active processes and show every process once

I have the following problem:

Print a Sorted List of active processes by size. Every process must be only 1 time in this list .

My solution is:
ps | sort | awk '{print $1}'

Can i have a little help?
 
Old 03-07-2008, 10:17 AM   #8
jianelisj
LQ Newbie
 
Registered: Mar 2008
Posts: 18

Original Poster
Rep: Reputation: 0
sort active processes and show every process once (NEW THREAD)

I have the following problem:

Print a Sorted List of active processes by size. Every process must be only 1 time in this list .

My solution is:
ps | sort | awk '{print $1}'

Can i have a little help?
 
Old 03-07-2008, 11:17 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Size of what? 'ps' has --sort as well ('man ps' for criteria) and if you add '-eo cmd' (or args) it'll only display those.
 
Old 03-07-2008, 11:20 AM   #10
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
if ps | sort | awk '{print $1}' shows you the information you want, but you need that information listed only once, pipe it through uniq.

ps | sort | awk '{print $1}' | uniq
 
Old 03-07-2008, 11:21 AM   #11
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be merged with http://www.linuxquestions.org/questi...s-once-626399/ and http://www.linuxquestions.org/questi...s-once-626318/ because it is a duplicate and both contain replies.

Note spamming LQ is not acceptable and the reason why you're doing this doesn't matter.

Last edited by unSpawn; 03-07-2008 at 11:23 AM.
 
Old 03-07-2008, 02:49 PM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Talk about gall!!!

After significant flak for posting homework, OP posts a new question without any acknowledgement of the interviening discussion.

100 demerits for jianelis---bad dog, VERY bad dog...
 
Old 03-07-2008, 02:59 PM   #13
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
A former boss of mine has attended a trade school. For the final each group was supposed to fix a Television. They had no idea how to proceed. One group dropped the set about 4 inches and it started working. A second group saw that and did the same. Sparks and smoke!

The school was shut down.
 
Old 03-08-2008, 04:32 PM   #14
sentient6
LQ Newbie
 
Registered: Mar 2008
Location: patrai
Distribution: ubuntu
Posts: 4

Rep: Reputation: 0
lol, i am at the same university with that guy!! i have found almost all the problems he has posted, but i cannot post it

it's not difficult, by my "colleague" is a little bit bored :P



also, he forgot to mention that he's using minix via vmware :P
 
Old 03-08-2008, 04:37 PM   #15
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by sentient6 View Post
lol, i am at the same university with that guy!! i have found almost all the problems he has posted, but i cannot post it

it's not difficult, by my "colleague" is a little bit bored :P



also, he forgot to mention that he's using minix via vmware :P
Perhaps you should tutor him on the fine art of 'Googling'
 
  


Closed Thread



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
sort active processes and show every process once jianelisj Linux - Newbie 5 03-07-2008 08:11 AM
SARG - sort process never finishes HiOctane21 Linux - Software 0 06-07-2006 05:53 PM
Show processes, not threads Martin Strand Linux - Newbie 1 06-14-2005 08:46 AM
monitoring active processes and identifying the required processes. gajaykrishnan Programming 2 08-13-2004 01:58 AM
Monitoring Active processes HeavyWater Linux - Newbie 4 07-07-2003 09:41 PM

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

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