how to find number of repeated words in file at starting of the sentence ? e.g.
abc bdbdndnvd hddh hcjdhjc dgdgd ghcdggcd abc hjdhcj abc ghdsgcgdc cdghcgd dhgch hshhj hcdhchd hdjchjd
only interested in repeated word in whole file at starting only. If that word anywhere else should not be counted.i.e. In above example
abc is repeated twice.
Can anyone suggest me how can I do this using command ? I am using Ubuntu 16.04.