Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is there any way to get just name and VPRVT of running processes?

share|improve this question
    
Something like ps -o pid,vsz or are you looking for help running AppleScript to call unix commands? –  bmike Mar 11 '13 at 16:20
    
Yes something like that. I tried your code, but all i got was 2 numbers. My AppleScript needs name and VPRVT of every running process. Thanks –  Johnnie Mar 11 '13 at 18:20
    
@bmike vsz (vsize / total virtual memory available) is not vprvt (used virtual private memory). top without arguments has columns for both. –  ؘؘؘؘ Mar 12 '13 at 8:13
    
@LauriRanta you are totally correct. My fishing lessons were quite vague here - more there are several manuals than RTFM. –  bmike Mar 12 '13 at 9:48

2 Answers 2

top -stats command,vprvt -l1 | sed '1,/^COMMAND *VPRVT/d'

-stats = shown columns, -l1 = exit after one sample. It cuts off long command names and uses human-readable sizes though.

share|improve this answer
    
do shell script "top -stats command,vprvt -l1 -o vprvt | sed '1,/^COMMAND *VPRVT/d'" Thanks Lauri, your code is what i was looking for. I figured out how to sort by vprvt. It could show longer process names too and for some reason, it shows all my running AppleScripts as "applet". –  user44948 Mar 12 '13 at 13:10

You could always restrict the columns Activity Monitor shows by right clicking the a column and deselect everything except Virtual Private Memory

screenshot of Activity Monitor

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.