I want to rename all the files in a folder which starts with 123_xxx.txt to xxx.txt.
For example, my directory has:
123_xxx
If the names are fixed you can visit each directory and perform the renaming in a subshell (to avoid changing the current directory) fairly simply. This is how I renamed a bunch of new_paths.json files each to paths.json:
for file in $(find root_directory -name new_paths.json)
do
(cd $(dirname $file) ; mv new_paths.json paths.json)
done