我有一个目录结构
base
|_folder_34231
| |_23491_this_I_want.csv
| |_23491_this_I_dont_want.csv
| |_some_other_things_I_dont_need
| |_some_other_folder_I_dont_need
|
|_folder_30941
| |_30912_this_I_want.csv
| |_30912_this_I_dont_want.csv
| |_some_other_things_I_dont_need
| |_some_other_folder_I_dont_need
|
|_folder_55587
| |_17777_this_I_want.csv
| |_17777_this_I_dont_want.csv
| |_some_other_things_I_dont_need
| |_some_other_folder_I_dont_need
|
|_folder_60920
| |_83821_this_I_want.csv
| |_83821_this_I_dont_want.csv
| |_some_other_things_I_dont_need
| |_some_other_folder_I_dont_need
我想复制全部将以“this_I_want”结尾的 csv 文件放入一个文件夹(例如命名为“target”),其他文件(包括非常相似的名为“this_I_dont_want”的文件)应该被忽略
我如何从终端执行此操作?
答案1
mkdir mycsv
find . -name "*this_I_want.csv" -exec cp -p -u {} mycsv \;