阅读278 返回首页    go iPhone_iPad_Mac_apple


iCloud Drive Symbolic Links broke Mac sidebar s...

So I wanted to make programming life easier by keeping content within my iCloud drive to not worry about my content being backed up. I didn't want to type the entire iCloud directory path before each of my scripts could be executed:

 

"/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/"

 

So I went to my home folder in terminal and wrote up a couple of symbolic links

 

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/" iCloud

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/Development" Dev

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/Development/CloudFormation" CF

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/Development/Python" Py

ln -s "/Users/[username]/Library/Mobile\ Documents/com\~apple\~CloudDocs/Development/myChef" Chef

 

But now, the iCloud shortcut icons on the left side of finder no longer work. More importantly, when i browse the iCloud drive, the Development folder has disappeared completely, and I can only get to it by its symbolic link. Same thing with the subfolders for CF, Py and Chef.

 

Does anyone know how to restore the original symbolic links for iCloud on my mac?

 

I have multiple Macs and would have to put those symbolic links on to each one of them to get proper access again.



The arguments in your ln command have a few mistakes in them so it created an invalid link. If you are escaping space with a \ then don't use quotes. If you are using quotes then don't use \ to escape anything however you should not put \ in front of ~ in either case because it doesn't need escaped. Also its best to put the full path to the destination of the symlink as well as the source.

 

Here is an example of how to symlink a "Projects" folder to iCloud Drive:

 

Create Projects folder on iCloud Drive. Replace your username:

 

 

ln -s /Users/mh/Library/Mobile\ Documents/com~apple~CloudDocs/Projects

/Users/mh/Projects

 

 

chflags -h hidden /Users/mh/Projects

 

The second command hides it from the home folder the same way the Desktop and Documents get hidden.

 

The very weird thing is that Apple actually do this the other way around. The data is in the Documents folder as normal (except it is hidden) and they put a symlink in iCloud Drive. We however can't put symlink in iCloud Drive so they must have some special handling in Finder to allow it.



最后更新:2017-08-20 19:20:31

  上一篇:go Homepod design re: RoHS technology
  下一篇:go TC Changed Name of Disk Back to "Data"?