如何将不包含一个特定目录的文件和目录移动到此目录 [英] How to move files and directories excluding one specific directory to this directory
问题描述
里面目录
〜/ domains / annejulie.blue-world.pl / git
我想要获取除 annejulie.blue-world.pl.git 目录之外的所有文件和目录,并将它们移动到该目录中 find 和 > grep 命令?是否有可能?
在终端中首先执行以下命令。这扩展了正则表达式。
shopt -s extglob
现在您可以执行以下mv命令:
mv!(< file / dir不被移动>)<目的地的路径>
例如,如果您在〜/ Test并且需要移动除〜/ Test / Dest to〜/ Test / Dest,假设你在〜/ Test $ / b
$ b
mv!( Dest)〜/ Test / Dest
inside the directory
~/domains/annejulie.blue-world.pl/git
i want to get all files and directories excluding annejulie.blue-world.pl.git directory and move them into that directory (annejulie.blue-world.pl.git)
How to do this in terminal with find and grep command? is it possible?
Execute the following command first in terminal. This extends regexes.
shopt -s extglob
Now you can execute the following mv command
mv !(<file/dir not to be moved>) <Path to dest>
For example, If you are at ~/Test and you need to move all except ~/Test/Dest to ~/Test/Dest, you can execute it as given below, assuming you are at ~/Test
mv !(Dest) ~/Test/Dest
这篇关于如何将不包含一个特定目录的文件和目录移动到此目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!