Below are the couple of ways with which we can replace/remove a file extension for a group of files.
i.e renaming a file from "abcxyz.processed" to "abcxyz".
method 1:
for file in *processed
do
mv -i "${file}" "${file/.processed/}"
done
method 2:
find . -name "*.processed" -exec rename 's/.processed$//' {} \;
i.e renaming a file from "abcxyz.processed" to "abcxyz".
method 1:
for file in *processed
do
mv -i "${file}" "${file/.processed/}"
done
method 2:
find . -name "*.processed" -exec rename 's/.processed$//' {} \;
No comments:
Post a Comment