doeknius_gloek, (edited )
@doeknius_gloek@feddit.de avatar

This line seems to list all dumps and then deletes all but the two most recent ones.

In detail:

  • ls -1 /backup/*.dump lists all files ending with .dump alphabetically inside the /backup directory
  • head -n -2 returns all filenames except the two most recent ones from the end of the list
  • xargs rm -f passes the filenames to rm -f to delete them

Take a look at explainshell.com.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • Ask_kbincafe
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines