Linux.com

CLI Magic: For geek cred, try these one-liners

Posted by: Anonymous [ip: 195.241.240.72] on July 23, 2008 12:23 PM
In case the ps example does not work correctly, it might help to add the option '-n' to the sort command. The -n tells sort that the sorting key is a number. Thus:

ps -eo user,pcpu,pid,cmd | sort -n -r -k2 | head -6

#

Return to CLI Magic: For geek cred, try these one-liners