I have a directory with a bunch of files names like this:
DetailedFeatureNameIntegrationTest.java
and I want to rename all the files to
DetailedFeatureNameIntegTest.java.
I just want to replace 'Integration' with 'Integ' is there a quick way to do this?
Using pure bash
,
for f in *.java; do
mv -- "$f" "${f//ration/}"
done
assuming you don't have a situation like both DetailedFeatureNameIntegrationTest.java
and DetailedFeatureNameIntegTest.java
already in the same directory.
使用perl rename
实用程序:
rename 's/Integration/Integ/' *.java
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.