What if you want to do something in Linux for a lot of files? [Numerator] was tired of using xarg and other ways to handle this job and created bashumerate.
Some examples in the post of the “other ways” include:
find . -name '*.log' | xargs rm
find . -name '*.sh' -exec wc -l {} \;
You can, also, use a for loop, and if you are a programmer at heart, you may well do this:
for f in *.txt; do wc -l "$f" done
Bashumerate handles all of the common cases in one tool and uses the same syntax for multiple kids of enumerations.
For example, the above translates to:
enumerate -f '*.sh' -- 'wc -l {}'
The -f means enumerate files. You can also enumerate lines, numbers in a range, or lists. What’s even more interesting is that you can add your own source. As an example, there’s an add-in function that enumerates running docker containers.
The source is all in bash, so it should be very portable. Will you try it? What’s your favorite way to enumerate in shell? Let us know in the comments. You know how we love strange bash tricks.

Please be aware that not escaping things can lead to issues, so it’s often better to do
find . -name ‘.log’ -print0 | xargs -0 rm
and not
find . -name ‘.log’ | xargs rm
And you probably want a “-type f” in there because directories can end in the letters “log” It’ll just throw an error, but it’s probably not what you intended.
I just use rm *.log
Less keystrokes.
OP’s is recursive, yours is not.
Seems a Linux Powershell version of Bashumerate would be interesting.
vi ListOfFilesInRightOrder.txt
Strg+v (visual block mode, mark the first column)
Shift+i “mv 0 ” Esc
Strg+v (mark the zeros)
g Strg+a (increases the n-th number by n, the g may be omitted for an increase of one everywhere or replaced by a number for an increase of number)
add leading zeros as needed (may this be automated? Starting with multiple zeros enumerates in octal)
:wq
chmod +x ListOfFilesInRightOrder.txt
./ListOfFilesInRightOrder.txt
maybe not very beautiful, but useful for occasional enumerations
Find can delete (“-delete” action) by itself, no needs to use xargs…
RTFM! (man find)
There are a few common points at which I decide, this is too much for a shell script, I’m doing it in perl, and needing xargs is one of them.
I prefer a fish for loop:
for file in *
wc -l “$file”
end
The part that trips me up occasionally is when I want to edit a bunch of files, and do:
ls *.txt | while read $f; do vi $f; done
only to be told that STDIN is not a terminal.
When I should rather do: for f in *.txt; do vi $f; done or better: vi $(ls *.txt)
Doh, and I should quote my arguments. vi “$f”