Issue in grep

view full story

http://www.unix.com – i have following pattern in file Code: s6:s2 s2:s4 s1:s2:s3:s4:s5:s6 s1 . . Now i want to find occurence of each record in file like s6:s2 occurs twice {once in first record and both occur in 3 record as well} so output should be Code: s6:s2  2 s2:s4  2 s1:s2:s3:s4:s5:s6  :1 s1 : 2                         ........ How to achive this.Also there are millions of records.so looking for best approach Moderator's Comments: (HowTos)