Today has the same knowledge how to batch change file suffix name in Linux, this question was asked three times, so here are a few solutions
A. Rename Solution
1. The Ubuntu system
Change the file with the suffix named. C in the current directory to a file of. h
2. Under the CentOS5.5 system
Change the file with the suffix named. C in the current directory to a file of. h
Two. Shell script resolution
#!/bin/bash find
./-name *.c | While read I
do
echo "$i";
MV $i. C $i. h Done
Three. Find Xargs Solution
Find./-name "*.C" | Awk-f "." ' {print $} ' | Xargs-i-t mv./{}.C/{}.h
Note that the third scenario is a recursive change that changes all matching files under the current directory and its subdirectories
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.