I encountered a new problem today. What if I want to cut off the suffixes in batches?
The specific commands are as follows:
find -name "*.txt" |for i in *;do mv $i `echo $i |sed 's/\.txt//g'`;done
find -name "*.txt" |awk -F'.' '{print $1} |xargs mv {}.txt {}
If you only want to modify the suffix name, use rename. The command is as follows:
rename .txt .bk *
The above is the detailed content of How to use commands to batch modify file names under CentOS?. For more information, please follow other related articles on the PHP Chinese website!