是什麼下面兩者之間的區別:find命令和-name選項懷疑
find . -type f -name \*.bmp
find . -type f -name *.bmp
我已經測試過,他們都返回相同的結果,所以有什麼不同_deep inside_
?
添加了來自removed answer:
所以這是爲了避免對特殊字符*****外殼擴展,只透過*作爲參數傳遞給find命令,讓它處理它。
但我的機器上,他們都好,都返回BMP文件和當前目錄下,僅舉幾例,結果如下圖所示,有些是爲了簡潔
./images/building_color.bmp
./images/building_gray.bmp
./images/car_gray.bmp
./images/temple_color.bmp
./images/boat_gray.bmp
./images/tools_gray.bmp
./images/temple_gray.bmp
./images/tools_color.bmp
./images/car_color.bmp
./images/boat_color.bmp
系統省略信息:
GNU的bash,版本4.1.5(1)-release(1486-PC-Linux的GNU)
的Linux sysabod-筆記本2.6.32-30-通用#59 Ubuntu的SMP週二3月1日21:30:21 UTC 2011 i686 GNU/Linux
更好地運行它作爲'find。 -type f -name'* .bmp'以避免shell擴展和目錄上的錯誤。 – Wes 2011-04-15 05:14:37