bash - How to find unique words from file linux -


i have big file, teh lines text numbers etc. [man-(some numers)] lot of man-somenumbers repeat in few lines, want count unique mans -words. cant use unique file , because text before man words different in each line. how can count unique man-somenumbers words in file ?

if understand want correctly, then

grep -oe 'man-[0-9]+' filename | sort | uniq -c 

should trick. works follows: first

grep -oe 'man-[0-9]+' filename 

isolates words file match man-[0-9]+ regular expression. list piped through sort sorted list uniq requires, , sorted list piped through uniq -c count how each unique man- word appears.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -