-4

I want to delete files and folders older than 15 days.

But Before deletion I want to check that those file and folders shouldn't use anywhere. How can i do that ?

is ps -ef works for this ?

Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81

1 Answers1

1

Using the find command:

find /path/to/folder -type f -mtime +15 -delete
AJW
  • 36
  • 3
  • 1
    `find /path/to/folder -type f -mtime +15 -delete -o -type d -mtime +15 -exec rmdir {} \;` does everything in one command. – Phylogenesis May 29 '15 at 09:52