find 与 cp 命令组合使用
查找到文件后,拷贝到指定路径
find ~/Downloads/ -name '*.torrent' -exec cp {} ~/Downloads/myTorrent \;
\;
前面有个空格,要注意,这是固定结构,请不要尝试改变
上面命令是在Downloads
目标中查找后缀为torrent
所有文件,并拷贝到myTorrent
目录中
查找到文件后,拷贝到指定路径
find ~/Downloads/ -name '*.torrent' -exec cp {} ~/Downloads/myTorrent \;
\;
前面有个空格,要注意,这是固定结构,请不要尝试改变
上面命令是在Downloads
目标中查找后缀为torrent
所有文件,并拷贝到myTorrent
目录中