1

I have a directory on my macOS that I hard-linked to my Google Drive folder, using

gln -d "path to directory" "path to Google Drive folder"

If I try to remove the directory from my Google Drive folder, using

rm -r "path to directory inside Google Drive folder"

the directory on my macOS is also deleted. Is there a "safe" way to remove the directory from my Google Drive folder (i.e., one that will keep the original directory in place)?

  • If you've got the GNU ln (gln) on your system, then you probably have the whole GNU coreutils package (did you install it via Homebrew or MacPorts or what?). It might be interesting to see if the GNU coreutils version of unlink(1) can successfully unlink one hardlink of the directory without unlinking the other. – Spiff Jul 13 '17 at 23:59
  • Yeah, I installed it via Homebrew. Can you elaborate on the unlink idea? – Skeptic Jul 14 '17 at 4:07
  • Well, I tried unlink and got an error, that the intended directory is a directory. Heh. Any other ideas? Thanks! – Skeptic Jul 17 '17 at 12:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.