I just looked up the man page, and actually head -n -2
means “everything up to but not including the last two lines”, so this should always leave two files remaining.
- 2 Posts
- 10 Comments
Ah! This is a shell pipe! It’s composing several smaller commands together, cool stuff.
-
ls -1
is the grep-friendly version of ls, it prints one entry per line, like a shopping list. -
head
takes a set number of entries from the head of a list, in this case2 items.negative two, meaning “all but the last two.” -
xargs
takes the incoming pipe and converts it into extra arguments, in this case applying those arguments torm
.
So, combined, this says “list all the .dump files, pick
the first two,all but the last two, and delete them.” Presumably the first are the oldest ones and the last are the newest, if the .dump files are named chronologically.-
klay@lemmy.worldto Steam Deck@sopuli.xyz•Top 20 games played on Steam Deck in the past month, sorted by playtime.1·2 年前Worth noting that Steam doesn’t track playtime for non-Steam games. So this doesn’t include Minecraft, Retroarch, or anything purchased through Itch, GOG, or Epic.
klay@lemmy.worldto Lemmy.World Announcements@lemmy.world•Lemmy.World Minecraft Server Announcement7·2 年前True… the trouble with open source is that nobody’s getting paid to add features you want, huh.
klay@lemmy.worldto Lemmy.World Announcements@lemmy.world•Lemmy.World Minecraft Server Announcement53·2 年前I’m excited! But why not Minetest? :p
klay@lemmy.worldOPto Reddit@lemmy.world•Reddit/Twitter alternatives with working search?English6·2 年前I don’t mind waiting a bit. If the system works, the users will come eventually.
klay@lemmy.worldOPto Reddit@lemmy.world•Reddit/Twitter alternatives with working search?English2·2 年前I mean, there’s Stackoverflow, and Steamcommunity. It can be done. I’d just like to see federation tackle it.
Right, which defeats the purpose of the “fediverse” imo.
klay@lemmy.worldto Fediverse@lemmy.world•Seeing how good Lemmy is makes me frustrated with MastodonEnglish1·2 年前Hear hear! I thought I didn’t like the fediverse because Mastodon did such an awful job selling it to me. “Oh, I can’t view other instances’ local timelines without making accounts on them? What’s even the point of federation then?” But on Lemmy you can easily browse communities outside your own instance. So it’s not the fediverse’s fault, Mastodon just doesn’t have a clear audience.
And yeah, I can see how a lot of Mastodon’s features are “privacy-focused”, but I think it does TOO good a job, it’s so private that you can’t find anything!
Won’t this delete the two newest files, as opposed to everything except the two newest files?