You can do it this way:
find . -name '123_*.txt' -type f -exec sh -c '
for f; do
mv "$f" "${f%/*}/${f##*/123_}"
done' sh {} +
No pipes, no reads, no chance of breaking on malformed filenames, no non-standard tools or features.
More Related Contents:
- How to loop through file names returned by find?
- Fast way of finding lines in one file that are not in another?
- How to use ‘find’ to search for files created on a specific date? [closed]
- How can I exclude all “permission denied” messages from “find”?
- Recursively rename files using find and sed
- Error when using ‘sed’ with ‘find’ command on OS X: “invalid command code .”
- How to recursively find the latest modified file in a directory?
- Delete files older than 10 days using shell script in Unix [duplicate]
- Unexpected operator error [duplicate]
- find: missing argument to -exec
- find files older than X days in bash and delete
- How can I get a recursive full-path listing, one line per file?
- How to go to each directory and execute a command?
- find -exec with multiple commands
- What is the best way to count “find” results?
- Looping through find output in Bash where file name contains white spaces
- Use GNU find to show only the leaf directories
- How can I compare numbers in Bash?
- echo “#!” fails — “event not found”
- Pipe output and capture exit status in Bash
- Shell redirection i/o order
- How to pass in password to pg_dump?
- How can I profile a Bash shell script slow startup?
- Select random lines from a file
- Creating a string variable name from the value of another string
- Passing arguments by reference
- How do I remove all .pyc files from a project?
- What does the double-asterisk (**) wildcard mean?
- How to send control+c from a bash script?
- Missing Carriage Return in Docker for Mac Containers