【问题标题】:Loop to move dir into same dir循环将目录移动到相同的目录
【发布时间】:2016-02-29 21:50:20
【问题描述】:

我有这个结构:

-father
 |-t1
   |-1.jpg
   |-...
 |-t2
   |-2.jpg
   |-...

我需要将文件夹 father/t1/... 移动到 father/t1/t1/...father/t2/...father/t2/t2/...

为了保持这种结构

-father
 |-t1
   |-t1
     |-1.jpg
     |-...
 |-t2
   |-t2
     |-2.jpg
     |-...

我需要一个命令来循环执行此操作,因为我需要移动许多文件夹。

谢谢

【问题讨论】:

标签: shell ubuntu directory


【解决方案1】:

mv file1 file2 target

mv folder1 folder2 target

只需在循环中将参数传递给它,甚至在 mv 之前传递 mkdir

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-03
    • 2011-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-29
    • 2014-03-03
    相关资源
    最近更新 更多