JunKing 发表于 2005-5-12 08:53:01

什么样将find命令所找到的文件mv 其他目录..

find /xxx/ -type f -name "x.x"|xargs mv -f /xxx/xxx {}\;
好不行..高手指教.. :o

zhy2111314 发表于 2005-5-12 08:59:38

mv -f $(find /xxx/ -type f -name "x.x") target_dir

BOoRFGOnZ 发表于 2005-5-12 09:26:24

find /xxx/ -type f -name "x.x" -exec mv -f {}\;

当使用诸如m v或r m命令时,可以使用- e x e c选项的安全模式

JunKing 发表于 2005-5-12 09:31:23

多谢版主热心帮助.

BOoRFGOnZ 发表于 2005-5-12 09:33:37

再给点信息:
f i n d命令是一个非常优秀的工具,它可以按照用户指定的准则来匹配文件。使用e x e c和 x a rg s可以使用户对所匹配到的文件执行几乎所有的命令。
:-D

JunKing 发表于 2005-5-12 09:37:55

target_dir 是不是支定目录??还是不行..出错..(-bash: syntax error near unexpected token `/home/yangqi/

JunKing 发表于 2005-5-12 09:46:19

find /home/yangqi/junking -type f -name "*.txt" |xargs mv -f指定目录..不知哪里出错...

mv -f $(find /home/yangqi/junking -type f -name "x.x")/home/kenny
也出现 mv:missing file argument



我用的是mandrake linux...

BOoRFGOnZ 发表于 2005-5-12 09:52:06

find /xxx/ -type f -name "x.x" -exec mv -f {}\;
这个?!
页: [1]
查看完整版本: 什么样将find命令所找到的文件mv 其他目录..