日期:2014-05-16  浏览次数:20805 次

linux find命令鲜为人知的用法(多目录查找)

?

第一种用法(多目录搜索):?

????? # find mediatek/ frameworks/ system/ external/? -iname "*sqlite*.c"

?

?find 其实是可以多个目录查找某个文件的。如上所示。

?

?

第二种用法(多文件搜索+多目录搜索):

?#?find mediatek/ frameworks/ system/ external/? -iname "*sqlite*.c" -o -iname "*sqlite*.cpp" -o -iname "*sqlite*.java"
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteFullExceptionTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteProgramTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteExceptionTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteConstraintExceptionTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteStatementTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDoneExceptionTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDiskIOExceptionTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteClosableTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteOpenHelperTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteMisuseExceptionTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteCursorTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteAbortExceptionTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteDatabaseCorruptExceptionTest.java
mediatek/frameworks/base/tests/database/src/android/database/sqlite/cts/SQLiteQueryTest.java
mediatek/external/sqlite/custom/sqlite3_android_custom.cpp
frameworks/base/core/jni/android_database_SQLiteConnection.cpp
frameworks/base/core/jni/android_database_SQLiteCommon.cpp
frameworks/base/core/jni/android_database_SQLiteGlobal.cpp
frameworks/base/core/jni/android_database_SQLiteDebug.cpp
frameworks/base/core/java/android/database/sqlite/SQLiteDatabaseLockedException.java
frameworks/base/core/java/android/database/sqlite/SQLiteStatementInfo.java
frameworks/base/core/java/android/database/sqlite/SQLiteAccessPermException.java
frameworks/base/core/java/android/database/sqlite/SQLiteCustomFunction.java
frameworks/base/core/java/android/database/sqlite/SQLiteDoneException.java
frameworks/base/core/java/android/database/sqlite/SQLiteMisuseException.java
frameworks/base/core/java/android/database/sqlite/SQLiteProgram.java
frameworks/base/core/java/android/database/sqlite/SQLiteAbortException.java
frameworks/base/core/java/android/database/sqlite/SQLiteDiskIOException.java
frameworks/base/core/java/android/database/sqlite/SQLiteCantOpenDatabaseException.java
frameworks/base/core/java/android/database/sqlite/SQLiteTransactionListener.java
frameworks/base/core/java/android/database/sqlite/SQLiteDebug.java
frameworks/base/core/java/android/database/sqlite/SQLiteConstraintException.java
frameworks/base/core/java/android/database/sqlite/SQLiteCursorDriver.java
frameworks/base/core/java/android/database/sqlite/SQLiteBindOrColumnIndexOutOfRangeException.java
frameworks/base/core/java/android/data