Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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 :)

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.