Friday, November 22, 2024

Google Drive: How to use symlinks to access your documents

Must read

Popular operating systems, including Microsoft Windows, Linux, macOS, and Ubuntu, support symbolic links. Android and iOS also have this feature, though it’s usually limited to system-level operations or specific apps. You can use symbolic links to access your local files and sync folders with cloud services like Google Drive, Dropbox, and OneDrive on a MacBook or a budget-friendly Android phone. Here’s a quick guide on how to leverage them with Google Drive.



Related

How to set up and use Google Drive on your Mac

You don’t need to deal with a below-average Google Drive web app on your Mac



Symbolic links, often called symlinks, are file system pointers that direct you to another file or folder located elsewhere on a computer system. For example, you have a folder of documents stored on your SSD at D:\ImportantDocs and want these documents automatically backed up and accessible from other devices using Google Drive.

Typically, Google Drive only syncs the contents of its designated folder, which is commonly found at C:\Users\YourName\Google Drive. Instead of moving your files to the Google Drive folder, create a symbolic link in the Google Drive folder that points to D:\ImportantDocs.

The files in D:\ImportantDocs are stored in C:\Users\YourName\Google Drive\ImportantDocs and automatically synced with Google Drive. This setup is handy for those who want the benefits of Google’s cloud storage without rearranging their local file to different locations or manually moving files into the cloud sync folder.


This method uses Google Drive’s built-in feature to create shortcuts within the Google Drive ecosystem in the web interface or Google Drive app. Here’s how to do so:

  1. Click the file for which you want to create a shortcut.
  2. Press Shift + Z. Alternatively, right-click the file and select Organize > Add Shortcut.
  3. Navigate to your chosen location and click Add.
    The image displays a Google Drive interface where a user is creating a shortcut

You’ll see a file that looks like a copy at the designated location. When you open it, you access the original file. Shortcuts can be identified by the small arrow displayed on their icons.

 The image shows a Google Drive interface with a shortcut file inside a folder named Shortcut Folder

Google Drive shortcuts are specific to Google Drive and function across different devices. These shortcuts do not sync content outside of Google Drive.

Shortcuts break when you delete the original. Shortcuts don’t break when you move the original to another folder.


When you set up an OS-level symlink, you’ll sync folders with Google Drive that aren’t in the Google Drive folder. These symlinks are specific to the computer on which they’re set up and have no distinctive icons in Google Drive, appearing as regular files or folders.

To create a symbolic link on Windows using the Command Prompt, right-click the Start button, choose Command Prompt or Windows PowerShell, and run it with Administrator permission.

To create a symbolic link, type the following command:

mklink /D "/path/to/link" "/path/to/target dir"

Then, replace “/path/to/target dir” with the directory you want to sync and “/path/to/link” with where you want the symlink to appear (this should be within your Google Drive folder). The final command looks like this:

mklink /D "C:\Users\YourName\Gdrive\Link" "C:\Path\To\External Folder"

This creates a symlink named Link in your Google Drive directory that points to External Folder on your system, allowing it to sync via Google Drive.


Related

How to access Google Drive on any device

You can access Google Drive on almost any device, but the best way to access it changes by platform

To create symbolic links on macOS, open Terminal, press Command + Space, type Terminal, and press Enter or navigate to the Applications > Utilities > Terminal. Then, enter this command:

ln -s "/path/to/target dir" "/path/to/link" 

Replace /path/to/link with the directory you want to sync and /path/to/target dir with the location where you want the symlink to appear (this should be within your Google Drive folder). The final command should look like:

ln -s "/Users/YourName/Path/To/External Folder" "/Users/YourName/Gdrive/Link"

This creates a symlink named Link in your Google Drive directory that points to External Folder on your system, allowing it to sync via Google Drive.


How to locate your file path on any computer

Use the Get Info option to obtain the file path on macOS. Right-click the file icon and select Get Info from the context menu, or select the file and press Command + I. In the Get Info window, look for the Where section, which displays the file path.

macOS Finder window showing the information for "My Drive" in Google Drive, indicating its location

On Windows, use the file properties to find the path. Right-click the file and choose Properties from the context menu. The Location field under the General tab shows the file path in the Properties window. Select the text in the Location field and press Ctrl + C to copy the path for use elsewhere.

Windows Explorer window with the properties of "My Drive" on Google Drive, detailing its location


Maximizing your productivity with Google Drive

Google Drive is a gem in Google Workspace, which is packed with handy features powered by artificial intelligence. We have several Google Drive tips to accelerate your productivity and improve your organization in Google Workspace.

Latest article