Quantcast
Channel: How to prevent grep from printing the same string multiple times? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 3

How to prevent grep from printing the same string multiple times?

$
0
0

If I grep a file containing the following:

These are wordsThese are wordsThese are wordsThese are words

...for the word These, it will print the string These are words four times.

How can I prevent grep from printing recurring strings more than once? Otherwise, how can I manipulate the output of grep to remove duplicate lines?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>