Created
December 15, 2015 19:21
-
-
Save dtateii/58738364009094371b0a to your computer and use it in GitHub Desktop.
Delete all except last N files
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
ls -tr | head -n -3 | sudo xargs --no-run-if-empty rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment