Can someone draw up a script that for every file, folder and subfolder and files that will copy the creation date over top of the modified date??
I know how to touch every file recursively, but no idea how to read a files creation date then use that to touch the modification date of that file, then do the same for the next, etc
Any help you could provide would be greatly appreciated
1) How to get the creation date
Use the command istat . For details see man istat .
2) How to set the date of a file
Use touch -t <time> . See the man page of touch for details.
3) How to circle through a set of files
Use the find -command. Basically, find starts at some "starting point" directory and works its way recursively from there, finding every filesystem entry there is. You can exclude (or include) certain files and/or directories, so that only a part of the whole set is produced. Once the set is what you want you can add a certain action to each item found that way by adding the "-exec"-clause. Here is an example:
This will start in "/some/dir", only include files ("-type f") in the result set, further restrict the result set only to names beginning with "AB" ("-name "AB*") and finally execute the command cp {} /other/place for each file found that way. The "{}" is a placeholder for the respective filename found that way which will be filled in by the find -command.
For details: again, see the man -page.
4) How to change the date from one format to another
You haven't told us which system you are on. If you have the date -utility from GNU: it can do that. If not: you will need to get one of the many solutions already published. Search the forum (or even the internet) for "date calculation" or something such and you will find a myriad of hits.
However, the Birth date, which I assume is the original creation date, does not seem to be maintained on my system (Linux Mint 17)
The output can be formatted.
veritron etc # stat -c "%x" hosts
2016-04-13 10:46:00.045167230 -0400