使用find并將結果傳遞給touch我們可以在多個目錄中創建一個檔案 -placeholder/dummy-:
find . -type d -exec touch {}/someFile \;
但是,它find . -type d還會回傳 - 并在當前目錄中創建一個檔案。
什么命令只在子目錄中創建檔案而不是當前目錄?
uj5u.com熱心網友回復:
有一個-mindepth選項:
find . -type d -mindepth 1 -exec touch {}/someFile \;
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/437087.html
上一篇:Python與Windows桌面
下一篇:無法訪問該檔案,因為它正在被使用
