When I am using xargs sometimes I do not need to explicitly use the replacing string:
xargs
find . -name \"*.txt\" | xargs rm -rf
In oth
Inspired by an answer by @justaname above, this command which incorporates Perl one-liner will do it:
find ./ -name \*.txt | perl -p -e 's/^(.*\/(.*)\.txt)$/mv $1 .\/foo\/$2.bar.txt/' | bash