Skip to content

Instantly share code, notes, and snippets.

@jaredcacurak
Created May 24, 2012 20:19
Show Gist options
  • Select an option

  • Save jaredcacurak/2783962 to your computer and use it in GitHub Desktop.

Select an option

Save jaredcacurak/2783962 to your computer and use it in GitHub Desktop.
Remove all but the five most recent text files starting with the prefix "boo" in the working directory without prompting.
for i in `ls -t boo*.txt | sed '1,5d'`; do rm -f $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment