I know some real perl basics, and I’ve been using this one liner to rename files:
find . -type f -exec perl -e 'rename($_,lc) for @ARGV' {} \;
The find passes a list of files to the perl one liner, which then renames them lowercase — but whats the {} for?
The ‘
{}‘ argument is part of the “find” command, not the “perl” command.Per the find man page documentation, the token ‘
{}‘ is replaced with the name of the current file being processed so it can be used by the target of the “exec” arguments, which are, in this case, “perl -e ...“.