So I have a bunch of files in different sub-directories that I want to print the NAME and PATH of these files into a single ".txt" file. This will be a recursive process as the files will be added daily and the ".txt" file will also be updated, so there is no fix amount of files. All the files will be in a ".txt" format.
For example:
C:\Users\jsmith\Desktop\File has folders File1 and File2
File1 contains File1.txt
File2 containts File2.txt
I want the outcome in the ".txt" file to look like:
File1
C:\Users\jsmith\Desktop\File\File1
File2
C:\Users\jsmith\Desktop\File\File2
Can dir /B /S /O > list.txt for UNIX too? That provides the path but what can I do for just the file names?
Copyright Notice:Content Author:「Eric Hong」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/55481795/unix-how-to-write-the-name-path-of-files-from-different-sub-directories-into