Linux command line find then take two actions

,

This is a Linux example of finding files throughout various folders, and for each file found put the file path into a text file then follow that up with the contents of that file.

find /media/Office-Files/Home/~STAFF -name “msgFilterRules.dat” -print0 | while read -d $’\0′ file; do echo “$file” %>> /home/tech/Documents/found.txt; cat “$file” >> /home/tech/Documents/found.txt; done