I have in file /tmp/users list of users ( each list contain diff users )
Example
more /tmp/users
root
kafka
yarn
hdfs
root
root
yarn
moon
apache
start
moon
apache
I want to print the users that appears in the file /tmp/users and count them as the following
Expected results
apache - 2
Hdfs - 1
Kafka - 1
Moon - 2
Root - 3
Start - 1
Yarn - 2
man sort
, andman uniq
. – ctrl-alt-delor Jan 20 '19 at 16:11