问题
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