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:
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!
cd
works, it's not an acces right/privacy issue. Does it work if you typecd Googl
, press TAB to have it auto-complete and then press ENTER?