前言
最近一个用户环境下,2号节点存放归档日志的文件意外丢失,导致原来存放在arch2中的归档日志生成/opt/sharedisk/arch22_58959_781640038.dbf,因为时间比较旧,归档日志有几百个,现在需要把所有名称类似arch22的日志批量更改名称,去掉前面的‘arch2’rename
简单语法: rename 要替换内容 替换内容 替换的文件列$ls
arch22_58951_781640038.dbf
arch22_58952_781640038.dbf
arch22_58953_781640038.dbf
arch22_58954_781640038.dbf
arch22_58955_781640038.dbf
arch22_58956_781640038.dbf
arch22_58957_781640038.dbf
$rename arch22 2 arch22*
$ls
2_58951_781640038.dbf
2_58952_781640038.dbf
2_58953_781640038.dbf
2_58954_781640038.dbf
2_58955_781640038.dbf
2_58956_781640038.dbf
2_58957_781640038.dbf