1

There is a perfect question for this but I can't comment due to reputation.

I'm using MacOS Sonoma 14.1.1.

If I list my home, I can see:

lrwx------    1 [myuser]  staff      88 Oct 11  2021 Google Drive -> /Users/[myuser]/Library/Application Support/Google/DriveFS/[long ID]/my-drive

The problem is that if I type "cd Google\ Drive", I get

cd: no such file or directory: Google Drive

But if I type "cd /Users/[myuser]/Library/Application Support/Google/DriveFS/[long ID]/my-drive", it's successful.

I also checked Settings -> Privacy and Security -> Files and Folders -> iTerm and Google Drive is switched on:

enter image description here

When I type "cd Goo" and then "tab", autocomplete works, but cd still complains:

cd: no such file or directory: Google Drive

Any way to enable the symlink, and be able to use it also in shell scripts?

Adding this as requested:

% ls -la ~/Library/CloudStorage/
total 32
drwxr-xr-x+   7 [myuser]  staff    224 Oct  6  2022 .
drwx------@ 112 [myuser]  staff   3584 Oct  4 07:12 ..
-rw-r--r--@   1 [myuser]  staff  14340 Jan 16 19:10 .DS_Store
drwx------@  81 [myuser]  staff   2592 Nov 29  2022 Dropbox
dr-x------@   8 [myuser]  staff    256 Jun  5  2023 GoogleDrive-[myemail]
dr-x------    3 [myuser]  staff     96 Jan 20  2023 GoogleDrive-[myemail] (2-6-23 11:12 AM)
drwx------    6 [myuser]  staff    192 Nov 25  2022 GoogleDrive-[myemail] (20-1-23 3:11 PM)

btw the proposed answer worked, the following link works:

% ln -s /Users/[myuser]/Library/CloudStorage/GoogleDrive-[myemail]/My\ Drive gdrive

but I still would like to find out why the other symlink doesn't!

8
  • Non-printing character in the filename? What happens if you type “cd Goog*”.
    – Linc Davis
    Commented Jan 12 at 16:01
  • If the long cd works, it's not an acces right/privacy issue. Does it work if you type cd Googl, press TAB to have it auto-complete and then press ENTER?
    – nohillside
    Commented Jan 12 at 16:26
  • Can you change directory if you enter the following: cd "Google Drive" ?
    – Martin
    Commented Jan 13 at 17:00
  • Your symlink is probably broken. Try recreating it.
    – Allan
    Commented Jan 13 at 20:42
  • So, if I type "CD Goo" and then tab, the autocomplete works, but cd still complains: cd: no such file or directory: Google Drive
    – flower42
    Commented Jan 15 at 9:45

1 Answer 1

1

There are several symbolic links involved here:

  • ~/Google Drive points to ~/Library/Application Support/Google/DriveFS/[long ID]/my-drive
  • .../my-drive is itself symlink pointing to ~/Library/CloudStorage/GoogleDrive-EMAIL-ADRESS/My Drive
  • .../My Drive is yet another symlink pointing to ~/My Drive (which contains the actual data)

The easy way to resolve this is to remove the Google Drive link and create a new one pointing directly to ~/My Drive:

rm ~/Google?Drive
ln -s ~/My\ Drive ~/Google\ Drive

You must log in to answer this question.

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