3

Is there a way for me to give my iCloud directory a "nickname" in the Terminal, that way I don't have to see "~/Library/Mobile Documents/com~apple~CloudDocs" in front of each line, but rather, can just see "iCloud" and know I'm in said directory?

  • can't you do a link? – jmh Oct 31 '17 at 21:15
6

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.

3

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .