Tuesday 3 November 2009

sort and uniq

tip to do sort and uniq on who command and see the no.of times a user has occurred:
who | awk '[print $1}' | sort | uniq -c

3 sriram
2 jadu
1 krishna

Reverse numeric sort order by skipping the heading.

sort -r -n +1

No comments:

Post a Comment

Tweets by @sriramperumalla