Yeah, tail
would be the more obvious choice instead of negating head.
Comment on Need help understanding a back-up script
tburkhol@lemmy.world 1 year ago
Others have explained the line.
Worth noting that not all implementations of head accept negative line counts (i.e. last n lines), and you might substitute tail.
i.e.: ls -1 /backup/*.dump | tail -2 | xargs rm -f
doeknius_gloek@feddit.de 1 year ago
klay@lemmy.world 1 year ago
Won’t this delete the two newest files, as opposed to everything except the two newest files?