News for hackers. Stuff that matters.
Re:Ask HN: Can I see your cheatsheet? by ptspts on Thursday June 30, 2022 @06:40AM (#31930740)
The zsh rm command doesn't with too many (say, 100 000) files, execve() fails with: Argument list too long. This works and it is relatively fast (runs rm in big batches): find ... | xargs -d '\n' rm --
Re:Ask HN: Can I see your cheatsheet? by tyingq on Thursday June 30, 2022 @08:05AM (#31931346)
Perl is also helpful to pipe to for any tool that outputs lists of files, like

  find . -type f -name '*foo' | perl -ne 'print;chomp;unlink'
And it has the same -0 switch as xargs to pair with find's -print0.

Not helpful in this case since you have other options, but maybe helpful for things like bulk touch, chmod, etc.

Re:Ask HN: Can I see your cheatsheet? by pmoriarty on Thursday June 30, 2022 @06:50AM (#31930800)
You can do the same with:

  zargs -- **/*(m+7) -- rm
I updated my answer above accordingly.
Re:Ask HN: Can I see your cheatsheet? by blaerk on Thursday June 30, 2022 @07:16AM (#31931002)
For you can skip xargs for that and just add the -delete argument to find, for readability and profit(!?)