0

I want to delete files in a folder that have creation time older than 1 day. How can I get those files?

Regards

user885883
  • 1
  • 1
  • 1

1 Answers1

0

Unix does not have creation time. You can try:

find /path/to/dir -type f -mtime +1 -exec rm {} \;

This will delete all files which were last modified more than 1 day ago.

If you want to look for files that have not been accessed in the last day, use the -atime argument instead.

dogbane
  • 266,786
  • 75
  • 396
  • 414