使用 Ubuntu 18.04。假设我们有一个名为debug.log. 您可以创建debug_BACKUP.log使用以下任一命令调用的副本:
cp debug.log debug_BACKUP.log
cp debug{,_BACKUP}.log
或者,替换cp为mv重命名文件。
现在假设我们有debug1.log和debug2.log。我们想创建名为debug1_BACKUP.log和的副本debug2_BACKUP.log。是否有一个命令可以实现这一点?
当我尝试以下任一方法时:
cp debug*.log debug*_BACKUP.log
cp debug*{,_BACKUP}.log
错误是cp: target 'debug*_BACKUP.log' is not a directory。