Chinaunix

标题: 请教! [打印本页]

作者: xin2v    时间: 2011-11-28 13:51
标题: 请教!
#pwd
/share/prd/rms/batch/IF/gdbi/
#ls
21-20111121-hq_batch.txt            40-20111031-hq_batch.txt            60-20111128-salein.txt
21-20111121-offtake.txt             40-20111031-offtake.txt             60-20111128-shop.txt
21-20111121-provider.txt            40-20111031-provider.txt            60-20111128-stock.txt
21-20111121-salein.txt              40-20111031-salein.txt              60-20111128-waredict.txt

# find /share/prd/rms/batch/IF/gdbi/ -name '*.txt' -mtime -1 -exec cp '{}' ./temp ';'
# ls
temp
# ls -l
total 0
-rwxr-xr-x    1 root     system         1277 Nov 28 2011  temp

想吧一天内的文件 移动到 当前的 temp目录下  结果 很奇怪  是temo
作者: xin2v    时间: 2011-11-28 13:54
find /share/prd/rms/batch/IF/gdbi/ -name '*.txt' -mtime -1  确实是一天内的
作者: dn833    时间: 2011-11-28 13:58
要先mkdir建立好目录
然后
find ./ -name "*.txt" -mtime -1|xargs -i  cp  {} ./temp
试试看呢
作者: xin2v    时间: 2011-11-28 13:59
本帖最后由 xin2v 于 2011-11-28 14:00 编辑

find /share/prd/rms/batch/IF/gdbi/ -name '*.txt' -mtime -1  | xargs -t -I {} cp {} ./temp

好了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2