I have a file containing many times the word "IPaddress". and i need a command that finds that string or word and print it only once. I've tried the following but they print a line for each match:
Having trouble understanding what you want, here are a couple of examples
This should print out the path of any file containing your string, note I used -type f to avoid looking at directories or special files and the -print0 and -0 args are to support files/directories with spaces -r stops grep being run if no files exist under path (ie find did not match any files):