【问题标题】:Find writable files in Mac OS在 Mac OS 中查找可写文件
【发布时间】:2013-04-17 14:07:06
【问题描述】:

我想在我的目录中找到(递归)可写文件。我的操作系统是 MacOS。

我试过了:

find . -type  -writable

但是shell返回错误:

查找:-type: -writable: 未知类型

为什么我得到了错误?有替代品吗?

【问题讨论】:

  • 试试 find -writable
  • @RachelGallen 没用,已经试过了。同样的错误。
  • -writable 类型在您的 find 命令中不存在。见man find。 @Thor 展示了查找可写文件的几种方法,具体取决于它们应该由谁可写(简而言之,ugo 是针对:用户?用户组?还是其他?)。使用正确的用户启动他的命令,并使用正确的 -perm ..... 以查看您想要查找的内容。您可以告诉我们您需要找出什么(哪些用户的文件不应哪些用户可写),我们将为您提供 . ....烫发你应该寻找。示例:linux.about.com/od/commands/a/blcmdl1_findx.htm
  • 选项“-writable”和“-readable”可能只适用于linux:小心!始终尝试学习(并坚持)便携方式......并提防在提供非便携选项时无法说明的网页。使用 -exec rm 和错误(非便携式)optinos 的发现可能是致命的......

标签: linux macos find


【解决方案1】:

谁写的?

如果你的意思是任何人都可以写,你可以使用:

find . -type f -perm -0222

find . -type f -perm -ugo=w

如果您的意思是other 可写,请使用:

find . -type f -perm -0002

find . -type f -perm -o=w

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-05
    • 2012-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-14
    • 1970-01-01
    • 2021-04-30
    相关资源
    最近更新 更多