Quote:
Originally Posted by prathamesh7478
Guys could you add your views and let me know
find . -type d -mtime +30 -name "1" -o -name "2" -o -name "3" -o -name "4"
|
You'll also need to review how boolean logic works and
the order of precence for boolean operators. Remember that between each option in
find there is an implied AND operator. So when mixing in some OR operators that needs to be taken into account, otherwise you will zap anything and everything in 2, 3, and 4 regardless of its age:
Code:
find . -type d -mtime +30 \( -name "1" -o -name "2" -o -name "3" -o -name "4" \) -print
But that might not get you what you want, if folders are empty. You might find the -mindepth and -daystart options useful.
Code:
find . -mindepth 2 -type d -daystart -mtime +30 \( -name "1" -o -name "2" -o -name "3" -o -name "4" \) -print