Last active
December 27, 2015 08:36
-
-
Save liangzan/41e96a106aa108c94bd0 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
# leaves 5 copies of the standalone app | |
total_files=$(find -name '*.jar' -type f -print0 | xargs -0 ls -t | wc -l) | |
file_num_to_remove=`expr $total_files - 5` | |
find -name '*.jar' -type f -print0 | xargs -0 ls -t | tail -n $file_num_to_remove | xargs rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment