Cygwin 具有特定扩展名的mv文件

Cygwin 具有特定扩展名的mv文件,cygwin,move,Cygwin,Move,我在电脑上使用cygwin,我希望将/pictures/(和子目录)中的所有.nef文件移动到一个新目录中,但我希望保留nef文件来自的目录名 ie/pictures/vacation2012/image01.nef 和 /图片/vac09/image01.nef 应该进入 /图片/nef/vac09/ 和 /图片/nef/vacation2012/您可以这样做: $ cd from_directory $ (tar cf - `find . -name "*.nef"`) | (cd to_d

我在电脑上使用cygwin,我希望将/pictures/(和子目录)中的所有.nef文件移动到一个新目录中,但我希望保留nef文件来自的目录名

ie/pictures/vacation2012/image01.nef 和 /图片/vac09/image01.nef

应该进入

/图片/nef/vac09/ 和
/图片/nef/vacation2012/

您可以这样做:

$ cd from_directory
$ (tar cf - `find . -name "*.nef"`) | (cd to_directory; tar xf - )
$ find . -name "*.nef" -exec rm -rf {} \; # be careful with this...