(我有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