gpt4 book ai didi

Bash One Liner : copy template_*. txt 到 foo_*.txt?

转载 作者:行者123 更新时间:2023-11-29 08:52:22 25 4
gpt4 key购买 nike

假设我有三个文件 (template_*.txt):

  • template_x.txt
  • template_y.txt
  • template_z.txt

我想将它们复制到三个新文件 (foo_*.txt)。

  • foo_x.txt
  • foo_y.txt
  • foo_z.txt

有没有一些简单的方法可以用一个命令来做到这一点,例如

cp --enableAwesomeness template_*.txt foo_*.txt

最佳答案

for f in template_*.txt; do cp $f foo_${f#template_}; done

关于Bash One Liner : copy template_*. txt 到 foo_*.txt?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26433/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com