gpt4 book ai didi

linux - Bash/Shell-将所有文件从子目录 move 到目标目录?

转载 作者:IT王子 更新时间:2023-10-29 00:09:46 28 4
gpt4 key购买 nike

我如何 bash 命令或 shell 脚本以将所有文件从子目录 move 到 Linux 中的一个目标目录?

最佳答案

如果您使用的是 GNU mv,-t 选项(目标目录)非常有用:

find sourcedir -type f -print0 | xargs -0 mv -t target 

man mv 提供了更多细节。

关于linux - Bash/Shell-将所有文件从子目录 move 到目标目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8561247/

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