I have following problem. I want to print content of several files. Each file is in different directory, and also has same name.
/home/User1/data.txt
/home/User2/data.txt
/home/User3/data.txt
Every file contains single string. I want to achieve following output:
User1 string_from_data.txt
User2 string_from_data.txt
User3 string_from_data.txt
I've tried to use following commend:
find . -iname "data.txt" | xargs cat
but it returns only contents of each data.txt
string_from_data.txt
string_from_data.txt
string_from_data.txt
How to write it properly?