To list folder less than 10:-
find . -maxdepth 1 -type d -exec bash -c "echo -ne '{} '; ls '{}' | wc -l" \; | awk '$NF<10'
To delete the folder less than 5:-
find . -maxdepth 1 -type d -exec bash -c "echo -ne '{} '; ls '{}' | wc -l" \; | awk '$NF<5' | xargs rm -rf
No comments:
Post a Comment