Skip to content

Instantly share code, notes, and snippets.

@andreasvirkus
Created September 4, 2018 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreasvirkus/570b3b6fa5143a40c70a8c8b0ba5667d to your computer and use it in GitHub Desktop.
Save andreasvirkus/570b3b6fa5143a40c70a8c8b0ba5667d to your computer and use it in GitHub Desktop.
# Remove all subdirs/files except latest 5 (starting from the 6th here)
rm -r `ls -t | tail -n +6`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment