New answers tagged uniq
grep tcp *.tcp | grep open | sort -u Giving multiple filenames to grep will, by default, cause grep to prefix the matching output lines with the filename(s) they matched in. The only other change I made was to combine sort | uniq into sort -u (and to remove the quotes that are unnecessary here).
grep -H 'tcp' -H, --with-filename Print the file name for each match. This is the default when there is more than one file to search.
Top 50 recent answers are included