LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sort active processes and show every process once (https://www.linuxquestions.org/questions/linux-newbie-8/sort-active-processes-and-show-every-process-once-626399/)

jianelisj 03-07-2008 12:00 AM

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

{BBI}Nexus{BBI} 03-07-2008 12:23 AM

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.

pixellany 03-07-2008 12:32 AM

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.

{BBI}Nexus{BBI} 03-07-2008 12:39 AM

Did the OP think we wouldn't realise. :D

pixellany 03-07-2008 08:09 AM

Quote:

Originally Posted by {BBI}Nexus{BBI} (Post 3080751)
Did the OP think we wouldn't realise. :D

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....;)

lord-fu 03-07-2008 09:11 AM

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.

jianelisj 03-07-2008 09:56 AM

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?

jianelisj 03-07-2008 11:17 AM

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?

unSpawn 03-07-2008 12:17 PM

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.

bigrigdriver 03-07-2008 12:20 PM

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

unSpawn 03-07-2008 12:21 PM

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.

pixellany 03-07-2008 03:49 PM

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...

jschiwal 03-07-2008 03:59 PM

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.

sentient6 03-08-2008 05:32 PM

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

{BBI}Nexus{BBI} 03-08-2008 05:37 PM

Quote:

Originally Posted by sentient6 (Post 3082431)
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' ;)


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