Answers for "Write a shell script to find out the unique words in a file and also count the occurrence of each of these words. We can say that the file under consideration contains many lines, and each line has multiple words."

0

Write a shell script to find out the unique words in a file and also count the occurrence of each of these words. We can say that the file under consideration contains many lines, and each line has multiple words.

sed -e 's/ /\n/g' filename | grep -v '^$' | sort | uniq -c | sort -n 
Posted by: Guest on September-21-2021

Code answers related to "Write a shell script to find out the unique words in a file and also count the occurrence of each of these words. We can say that the file under consideration contains many lines, and each line has multiple words."

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language