I have a list of folders and inside every folder I have the file  file.txt which has the same name in all the folders. I wanted to collect the path for this file from all the folders and save it in a text file. In order to do so, I ran the following command in the parent folder :find $PWD -type f -name file.txt > paths.txtThis command stored all the paths to this file from all the folders, in the filepath.txt  as follow:a/b/c/1/file.txta/b/c/2/file.txta/b/c/3/file.txta/b/c/4/file.txta/b/c/5/file.txta/b/c/6/file.txta/b/c/7/file.txt....How can I create space between the lines in the file path.txt so it can show as follow:/a/b/c/1/file.txt /a/b/c/2/file.txt /a/b/c/3/file.txt /a/b/c/4/file.txt /a/b/c/5/file.txt /a/b/c/6/file.txt /a/b/c/7/file.txt ...
Add space between files paths
text processing;find
You can also take advantage of the fact that the shell strips newlines from command substitutions. So, instead of find $PWD -type f -name file.txt > paths.txt, you can do (note that you don't need the $PWD, it is the default value for find):echo $(find $PWD -type f -name file.txt) > paths.txtorprintf '%s ' $(find $PWD -type f -name file.txt) > paths.txt