V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
cruii
V2EX  ›  程序员

不小心执行了 chmod 777 -R

  •  
  •   cruii · 2019-12-25 17:23:52 +08:00 · 3445 次点击
    这是一个创建于 1574 天前的主题,其中的信息可能已经有所发展或是发生改变。
    今天没有注意所在目录直接敲了个 chmod 777 -R
    把 /usr/local/下的目录全改了
    有没有办法弄回去啊,看着好难受啊
    8 条回复    2019-12-25 20:09:00 +08:00
    julyclyde
        1
    julyclyde  
       2019-12-25 17:26:13 +08:00
    /usr/local 都是自己编译的内容
    你重新编译一遍就行了
    cruii
        2
    cruii  
    OP
       2019-12-25 17:36:49 +08:00
    系统是 macOS 10.15.2
    index90
        3
    index90  
       2019-12-25 17:38:54 +08:00
    拿别人的系统,对着重新设一遍
    lrvy
        4
    lrvy  
       2019-12-25 17:39:46 +08:00   ❤️ 6
    haozxuan001
        5
    haozxuan001  
       2019-12-25 18:20:57 +08:00
    我理解,改大了好像并不会影响什么
    263
        6
    263  
       2019-12-25 19:20:57 +08:00
    目录
    find /usr/local -type d -exec chmod 755 {} \;

    文件
    find /usr/local -type f -exec chmod 644 {} \;

    可执行
    find /usr/local -type f -name "*.sh" -exec chmod +x {} \;
    hualuogeng
        7
    hualuogeng  
       2019-12-25 19:59:04 +08:00
    @haozxuan001 安全
    laibin6
        8
    laibin6  
       2019-12-25 20:09:00 +08:00 via iPhone
    mac 不是还有加个 sudo 才行吗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   947 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:45 · PVG 05:45 · LAX 14:45 · JFK 17:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.