Rename Files Matching Pattern in Bash (Using mv and sed)
It seems that the 'rename' command is not available in your current shell. You can try using the 'mv' command instead to achieve the same result:/n/nbash/nfor file in frame.pdb.*; do/n mv '$file' /'$(echo '$file' | sed 's/frame//.pdb//.(//d+)/frame_$1.pdb/')/'/ndone/n/n/nThis loop will iterate over all files matching the pattern 'frame.pdb.*', and for each file, it will use 'sed' to replace the pattern 'frame.pdb.(/d+)' with 'frame_$1.pdb'.
原文地址: https://www.cveoy.top/t/topic/fU0O 著作权归作者所有。请勿转载和采集!