I’m looking for a short awk / sed script to extract the rss information from the proc/smaps file which has the following records format:
77f73000-77f74000 rw-s 00000000 fd:00 230116 /var/lib/mylib.so
Size: 4 kB
Rss: 4 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 4 kB
Private_Dirty: 0 kB
The output I’m looking for is:
/var/lib/mylib.so 4
- extra bonus if the records can be sorted by rss size (large chunks first)
Thanks in advance,
Avner
Not sure about your selection criteria, but this only matches when an actual path is listed:
Append
sort -nr -k2,2to do descending sort on second column.