copy all *.so files excluding libgcc*.so [closed]

南楼画角 提交于 2019-12-12 18:43:14

问题


lib1.a
lib2.a
lib1.so
lib2.so
libgcc1.so
libgcc2.so
libgcc3.so
lib3.so

How can I copy all *.so files excluding libgcc*.so i.e. copy the following files:

lib1.so
lib2.so
lib3.so

?


回答1:


Try using find:

find path/to/src-dir -name '*.so' ! -name 'libgcc*.so' \
    -exec cp '{}' /path/to/dst-dir \;



回答2:


In bash, you can use extended globbing:

shopt -s extglob
cp !(libgcc*).so destination/


来源:https://stackoverflow.com/questions/14822102/copy-all-so-files-excluding-libgcc-so

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!