Quote:
Originally Posted by timothee
...
I want to build myself a shell script to transfer all files under directory "A", to directories "B/date_of_the_file", where "date_of_the_file" is the date, in format YYYY_MM_DD, of the creation date of the file.
|
You can't get the actual creation time of a file but
but
Code:
stat -c %y filename
returns the last modified time like this: 2005-11-11 18:52:57.000000000 -0600
This is fairly easy so I'll let you work it out.
Hint: use a for loop; cut and command substitution to process the stat output.
Also use 'echo' instead of mv or cp to see exactly what happens before you destroy something important
Post if you get stuck.
[Slight edit to clarify sentence.]