Renaming the iCloud folder in the Terminal, but not renaming the actual file itself

How about creating a symbolic link to that directory on your Desktop or in another easily accessible directory?

ln -s ~/"Library/Mobile Documents/com~apple~CloudDocs" ~/Desktop/iCloud

Note that you need to have the ~/ outside of the double quotes in order for the link to correctly resolve to your home directory, otherwise it will try to link to the literal directory ~ which of course won't exist.


Generic unix-y answer is to create a soft link:

cd ~
ln -s "Library/Mobile Documents/com~apple~CloudDocs" myShortName

Now you can:

cd ~/myShortName/

Notes:

  • The new name will also appear in the finder.
  • if you cd -P ~/myShortName or use pwd -P in that directory, you will see the full ...~CloudDocs path
    • For more about this see the "SHELL BUILTIN COMMANDS" section of man bash