Here is the structure of my dir:
./archive
/sub1
- file1
- file2
/sub2
- file3
- file4
I try with this command to find all the files that older than 6 months to delete it:
find ./archive -mindepth 1 -mtime +180 -delete
All the files and sub directory is deleted, what I want just the file1, file2, file3, file4 that delete, not include the sub1 and sub2, please advise.
findsupports the-typeoption. Use that to specify regular file withfas the argument.