Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Sistemi operativi I > Esame di laboratorio (Giugno 2007) - Domande Thread Rating: 3 votes, 5.00 average.
Pages (571): « First ... « 446 447 448 449 [450] 451 452 453 454 » ... Last »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
mark
.grande:maestro.

User info:
Registered: Oct 2003
Posts: 783 (0.10 al dì)
Location:
Corso: F49
Anno: finito!
Time Online: 8 Days, 18:34:33 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by xSharKMaNx
E' un pò diverso, se devi selezionare i 5 file ".c" di dimensioni maggiori fai semplicemente:

code:
find / -type -name "*.c" | xargs du | sort -nr | head -5


L'awk utilizzato nell'esercizio precedente ti evita di effettuare un loop per effettuare la sommatoria.


uhm...sai che stavo pensando che invece sia possibile anche con awk ?

Trovare il processo con pid dispari che occupa più spazio in memoria

prima versione
code:
ps -axl | tr -s " " : | for i in $(cut -d : -f 5-9); do pid$=(echo $i | cut -d -f 1); sz$=(echo $i | cut -d -f 4); if [ $pid % 2 -eq 1 -a $sz > 0 ]; then echo $pid $sz; fi; done; | sort +1 -n | tail -1


seconda versione con awk
code:
ps -axl | awk '{if($4 % 2 && $7 > 0) print $4, $7}' | sort +1 -n

__________________
Non ti perdere di coraggio se ti tocca lavorare molto e raccogliere poco.....

Last edited by mark on 16-09-2009 at 10:18

16-09-2009 10:14
Click Here to See the Profile for mark Click here to Send mark a Private Message Find more posts by mark Add mark to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 21:36.    Post New Thread    Post A Reply
Pages (571): « First ... « 446 447 448 449 [450] 451 452 453 454 » ... Last »   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.086 seconds (56.96% PHP - 43.04% MySQL) con 24 query.