Created
November 25, 2014 00:00
-
-
Save Sushant/06b3b9a06c9508c15617 to your computer and use it in GitHub Desktop.
Remove all dirs except the 10 most recent ones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in `ls -t | awk 'NR>10'`; do if [[ -d $i ]]; then rm -rf $i; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment