In a Unix Shell you can use the following to print a list of all files and subfolders recursively:
cd some/path/to/folder
du -aand you can list file information (such as permissions and timestamps) with the following:
stat filename.extIs there a way you can combine the commands to list all the files and subfolders of a directory recursively (with relative path) followed by the modified time? For example:
a_file.txt: 06/27/19 - 08:34:16
a_subfolder: 07/30/18 - 18:23:14Bonus: Something that will work for both Linux and OSX, and output to a txt file
21 Answer
You can provide a format to stat: stat -c '%n: %y' somefile will print the name and last modification time of somefile (%n actually replicates the parameter passed as a filename).
find [...search parameters...] -exec somecommand {} \; iterates alld files and directories and executes somecommand on every file/directory that matches, passing the file/directory name as a parameter.
Putting it all together:
find . -exec stat -c "%n: %y" {} \;... will iterate all the files and directories under the current directory, and print their name and last modification date.
1