awk次数统计

  1. portmapper
    portmapper
    portmapper
    portmapper
    portmapper
    portmapper
    status
    status
    mountd
    mountd
    mountd
    mountd
    mountd
    mountd
    nfs
    nfs
    nfs_acl
    nfs
    nfs
    nfs_acl
    nlockmgr
    nlockmgr
    nlockmgr
    nlockmgr
    nlockmgr
  1. awk '{arr[$1]++}END{OFS="\t";for(idx in arr){printf arr[idx],idx}}' a.txt