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
The following command constructs the move command with xargs, replaces the second occurrence of '.' with '.bar.', then executes the commands with bash, working on mac OSX.
ls *.txt | xargs -I {} echo mv {} foo/{} | sed 's/\./.bar./2' | bash