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
It is possible to do this in one pass (tested in GNU) avoiding the use of the temporary variable assignments
find . -name "*.txt" | xargs -I{} sh -c 'mv "$1" "foo/$(basename ${1%.*}).new.${1##*.}"' -- {}