我試圖用幾個子目錄刪除名爲dinkelsbuhllectura
的目錄。無法使用rm -rf刪除目錄
I'using以下命令:
$ rm -rf dinkelsbuhllectura/
但不是工作,我得到了一堆告訴我,一定子目錄是不是空的消息。但我已經知道這就是爲什麼我使用-rf選項。
的錯誤是這樣的:
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/objects/23: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/objects/21: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/objects/da: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/objects/e6: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/objects/e8: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/objects/33: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/objects: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/hooks: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/info: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/logs/refs/remotes/origin: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/logs/refs/remotes: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/logs/refs/heads: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/logs/refs: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/logs: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/refs/remotes/origin: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/refs/remotes: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/refs/heads: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git/refs: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5/.git: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q5: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/objects/a4: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/objects/99: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/objects/4e: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/objects/08: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/objects/23: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/objects/e6: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/objects: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/hooks: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/info: Directory not empty
rm: dinkelsbuhllectura//nddm-l4d1p2q4/.git/logs/refs/remotes/origin: Directory not empty
編輯此外應注意:
如果我嘗試在Finder中,它說要刪除此:
The operation can’t be completed because the item 「23」 is in use.
謝謝。
用'sudo'執行它。我遇到過類似的情況,通常是因爲權限問題。在我的情況下 - root已經檢出了github repo,因此所有內容都在'。git'歸根 – sircapsalot
同樣的問題:( – Jeff
你在mac? – CodeWizard