I am trying to to create a shell script to echo the contents of a file that I am not sure where to find it.
I thought it would be something like:
$echo | ls /* | grep file.xml
where my file could be in some unknown subfolder so I am trying to search for it’s path with grep.
Any help on correct syntax would be greatly appreciated!
You can use
find:/says to look in/and its subdirectories;-name file.xmlsays to find files namedfile.xml; and-exec cat '{}' ';'says to run, e.g.,cat /path/to/file.xmlfor each of those files, which prints out their contents.