(我有Ubuntu) 我的計算機上有一些git存儲庫。所以我想在一個命令中擁有所有的狀態。 (:在find/-name ".git"
爲d;做CD $ d/..;回聲pwd
:@jmlane; git的狀態;回聲;完成),我發現這個答案How can I view all the git repositories on my machine?如何在沒有權限的情況下查找所有.git否認消息?
但我有很多的 「權限被拒絕」 的消息。所以我搜索並找到了這個答案How can I exclude all "permission denied" messages from "find"?,但我不知道如何將它添加到我的問題。
我試圖find -name ".git" | grep -v "Permission non accordée"
,但我也有同樣的結果只是find -name ".git"
:
find: «./.cache/dconf»: Permission non accordée
find: «./.dbus»: Permission non accordée
./Documents/these/programmes/programme_ccm/.git
./Documents/these/rapports/centralisation/.git
./Documents/these/rapports/Barberis_review_2016/.git
./Documents/these/rapports/biblio/.git
我試圖find -name ".git" 2> grep -v "Permission non accordée"
沒有結果
但當我find -name ".git" | grep "Permission non accordée"
我獲得
find: «./.cache/dconf»: Permission non accordée
find: «./.dbus»: Permission non accordée
您是否嘗試過使用su/sudo命令來啓動它的管理權限? – vmchar
可能重複的https://stackoverflow.com/questions/762348/how-can-i-exclude-all-permission-denied-messages-from-find – AllAnimals
@vmchar我現在試過了:不工作 – Ccile