LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-07-2008, 12:00 AM   #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-07-2008, 12:23 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 5, Linux Lite
Posts: 4,312

Rep: Reputation: 208Reputation: 208Reputation: 208
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-07-2008, 12:32 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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-07-2008, 12:39 AM   #4
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 5, Linux Lite
Posts: 4,312

Rep: Reputation: 208Reputation: 208Reputation: 208
Did the OP think we wouldn't realise.
 
Old 03-07-2008, 08:09 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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, 09: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, 09: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, 11: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, 12:17 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
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, 12:20 PM   #10
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
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, 12:21 PM   #11
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
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 12:23 PM.
 
Old 03-07-2008, 03:49 PM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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, 03:59 PM   #13
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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, 05: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, 05:37 PM   #15
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 5, Linux Lite
Posts: 4,312

Rep: Reputation: 208Reputation: 208Reputation: 208
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


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


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