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

是否可行: ln -s ~/Documents/MyOwnDownloads ~/Downloads

  •  
  •   zenwong · 2021-08-04 08:22:07 +08:00 · 1963 次点击
    这是一个创建于 967 天前的主题,其中的信息可能已经有所发展或是发生改变。
    rm -rf ~/Downloads
    ln -s ~/Documents/MyOwnDownloads ~/Downloads
    

    是否可行?是否工作正常如原生 ~/Downloads ?

    第 1 条附言  ·  2021-08-04 16:46:34 +08:00
    ~/Documents/ 在 iCloud Drive 上
    8 条回复    2021-08-04 18:31:14 +08:00
    leonme
        1
    leonme  
       2021-08-04 08:35:52 +08:00 via iPhone
    是的
    IgniteWhite
        2
    IgniteWhite  
       2021-08-04 08:43:14 +08:00
    macOS 自己用 Finder 能创建的快捷方式是 alias,和你创建的 symlink 稍有区别,参见 https://apple.stackexchange.com/a/323217/350878

    按照这个链接的解释,symlink 是否可行要看你希望后面做什么事了:if you move a file, aliases are superior since they can often still point at the correct file when a change happens.
    dozer47528
        3
    dozer47528  
       2021-08-04 10:02:29 +08:00
    可行,但不是所有 App 都 follow 了 symlink 。
    我测试下来,截图不行,Mail 不行,需要重新手动指定到新的地址
    Volekingsg
        4
    Volekingsg  
       2021-08-04 10:05:01 +08:00
    可以,比如说我把 Documents 软链接到了 Dropbox 中的 Document,不过记得把这个文件锁起来,否则在较新的几个版本的 macOS 上重启后会自动删除软链接恢复成文件夹

    rm -rf ~/Documents && ln -s ~/Dropbox/Documents ~
    SetFileIcon -image ~/Pictures/icons/macOS_Documents.icns -file ~/Documents
    sudo chflags -h uchg ~/Documents
    maizero
        5
    maizero  
       2021-08-04 10:06:06 +08:00
    关注
    wclebb
        6
    wclebb  
       2021-08-04 11:16:43 +08:00
    这个思路可行,毕竟下载的文件有时候懒得清理但还是占用宝贵的空间。
    MrCurly
        7
    MrCurly  
       2021-08-04 14:28:25 +08:00
    没太理解,这么做能实现什么特殊的需求么?毕竟能操作 downloads 就能操作 myowndownloads
    daveh
        8
    daveh  
       2021-08-04 18:31:14 +08:00 via iPhone
    可行,但 Documents 在 iCloud Driver 上,意味你下载到 Download,又要上传一遍到 iCloud 。。。网速快不是问题。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1398 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:31 · PVG 01:31 · LAX 10:31 · JFK 13:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.