我正在使用find命令來創建我想用於分發包的文件列表。卻發現不能得到所有的文件列表查找命令不一致的輸出,通配符無法正常工作
下面是我的目錄結構
.
├── 1.cpp
├── test
│ └── 1.cpp
└── test1
├── 1.cpp
└── test11
├── 1.h
└── 2.cpp
以下
的命令及其輸出(注:不帶./test1/test11/ 2.cpp)
$ find . -name *.cpp
./test/1.cpp
./1.cpp
./test1/1.cpp
然而,當我使用的具體名稱是能夠找到該文件
$ find . -name 2.cpp
./test1/test11/2.cpp
您可以試試這個搜索。名稱「* .cpp」 –
工作表示感謝。請添加回答 – Count