Use:
find . -name "*.t1" -exec bash -c 'mv "$1" "${1%.t1}".t2' - '{}' +
If you have rename
available then use one of these:
find . -name '*.t1' -exec rename .t1 .t2 {} +
find . -name "*.t1" -exec rename 's/\.t1$/.t2/' '{}' +
More Related Contents:
- What does set -e mean in a bash script?
- What does $@ mean in a shell script?
- Check if a string matches a regex in Bash script
- Shell script: Run function from script over ssh
- Why does /bin/sh behave differently to /bin/bash even if one points to the other?
- How do you extract IP addresses from files using a regex in a linux shell?
- How do I use a regex in a shell script?
- How to match a pattern given in a variable in awk?
- Randomly shuffling lines in Linux / Bash
- What’s the point of eval/bash -c as opposed to just evaluating a variable?
- Grep and regex – why am I escaping curly braces?
- How to make “grep” read patterns from a file?
- Reading quoted/escaped arguments correctly from a string
- Regex (grep) for multi-line search needed [duplicate]
- What’s the magic of “-” (a dash) in command-line parameters?
- How can I remove the extension of a filename in a shell script?
- Is there a “goto” statement in bash?
- How do I use regular expressions in bash scripts?
- How can I generate new variable names on the fly in a shell script?
- Insert contents of a file after specific pattern match
- Bash while read loop extremely slow compared to cat, why?
- Find multiple files and rename them in Linux
- How does Ctrl-C terminate a child process?
- How can I loop over the output of a shell command?
- Command to get time in milliseconds
- Get a list of function names in a shell script [duplicate]
- Insert multiple lines into a file after specified pattern using shell script
- Get ceiling integer from number in linux (BASH)
- How can I trim white space from a variable in awk?
- How to convert hex to ASCII characters in the Linux shell?