Everyday new audio files are created in dir1
.
Sometime I move (mv
) some files from dir1
to dir2
I want to delete all the files in dir2
that was moved before 20th June
Is this possible?
Everyday new audio files are created in dir1
.
Sometime I move (mv
) some files from dir1
to dir2
I want to delete all the files in dir2
that was moved before 20th June
Is this possible?
I don't agree with first answer: it seems it's possible. mv preserves mtime (modification time), but it changes ctime (change time). So it's should be possible to archieve this by doing find dir2 -ctime +30 -delete
(or whatever other expression with ctime).
PS: and don't forget to double-check your command by running it with -print
instead of -delete
:)
No, this isn't possible, because mv
preserves the original mtime of the file when it's moved, so there's no record (within the file metadata) of when a file was moved.