5 Ways To Reveal The Path Of a File On MacOS.
When you create or copy a file to your Mac, a path is assigned to it, which is the actual location of the file on your Mac. The paths make it easy to navigate to any folder or files on your computer, as they represent the complete address of a file saved on your computer.
Sometimes, you may need to provide the path to a file on your Mac for various reasons. You may be writing a program that takes a file path as input. Or maybe you’ve installed an application on your Mac and it asks you to enter the path to your file.
Regardless of why you want to expose the file path, there are several ways to do it on your computer. MacOS comes with a number of options to help you view and even copy the full path to any file saved on your computer.
If this is not so easy for you, you can even create your own Automator service that copies the path to the file of your choice with one click.
Also, feel free to check out our YouTube channel on our sister site, where we’ll go over the various techniques in a short video.
Finding file paths using the info window
Detect file paths using info box
If you’ve used a Mac for a while, you may have seen the Get Info option that appears when you right-click a file.
This option opens a window that displays all the information about your file. This information includes the file name, file type, file size, and most importantly, the file path.
To verify this, open a Finder window, right-click any of your files, and select Get Info.
On the next screen, look for the label that says “Where” and you will see the full path to the selected file on your Mac. It shows in which folders and subfolders your file is located.
While it works great in helping you find the file path, it doesn’t allow you to copy the file path as plain text if that’s what you wanted to do. If you want to copy the file path to the clipboard, you can use some of the other methods mentioned below.
Copy paths to files from the context menu
Copy file paths from context menu
The context menu on your Mac is a really powerful tool as it allows you to do much more with files than just rename or delete files.
One of the useful and hidden options in the context menu allows you to directly copy the file path to the clipboard.
Since it is hidden by default, it does not appear when you right click a file on Mac. However, showing this option is pretty straightforward, and all you have to do is press and hold the Option key. This will make the parameter visible in your context menu.
To use this option, right-click a file in the Finder, hold down the Option key on your keyboard, and you will see the Copy “file-name.ext” option as the path. Click on it to copy the file path.
The path to the selected file will be copied to the clipboard as plain text.
Use Finder to View File Paths
Use the finder to view file paths
You might be thinking that if Finder is a file management application, then why doesn’t it have a copy paths feature? Unfortunately, in the current version of Finder there is no already visible option for copying file paths.
However, this does not mean that there is actually no way to view file paths using the Finder. This is indeed a feature that is not meant to expand file paths, but helps you view the file paths on your computer.
It’s called the Go To Folder feature, and it’s actually designed to help you navigate anywhere on your Mac. But you can use it to show file paths as shown below.
While in the Finder window, click Go at the top and select Go to Folder.
When the dialog box opens, drag the file to the input field and it will be filled in with the path to your file. Then you can copy the path to the clipboard with Command + C.
Viewing file paths using terminal
View file paths using Terminal
Many users might think that the Terminal app on your Mac is just for programmers or people who love to program. While this is the case and the application allows you to execute various commands, it can also be used for basic tasks such as copying file paths.
The app really helps to identify file paths, and it’s pretty easy to do. Launch the application on your Mac and drag the file into its window. The full path to the selected file will appear in the Terminal window.
This is also useful when you are writing a command and need to enter the full path to a file. Instead of typing, you can drag and drop the file and it will fill in the required data for you.
Create an Automator service to copy file paths
Create an Automator service to replicate file paths
If you are using a version of macOS that does not have the option to copy file paths from the context menu, you can add this option to the menu yourself using the Automator service. An Automator service is a user-defined set of tasks that are performed when a service is invoked.
This may sound too programmatic, but in practice it is not that difficult to do. In fact, all you have to do is drag the action from here to there, and you have a service out of the box with Automator.
- Launch the Automator app and select Tools and then Select. This will allow you to create a custom service on your computer.
- Configure the options at the top of the main panel as follows:
The service gets the selected – files or folders
into – Finder
- Find the action named “Copy to Clipboard” in the left pane and drag it to the main pane.
- Your service is ready and it’s time to save it. Click “File” at the top and select “Save.” Enter the name of the service – it will appear when you right-click the file – and click Save.
You are now ready to copy file paths using the context menu on Mac. Find the file you want to copy the path to, right-click it and select Services, then provide a name for the service.
The full path to the file will be copied to the clipboard in plain text format.
Bonus tip: assign a keyboard shortcut for the Automator
Bonus tip: Assign a keyboard shortcut for Automator
If you want to make it easier to copy file paths, you can assign a keyboard shortcut to your custom Automator service. Therefore, when you press this key combination, the path to the selected file will be automatically copied to your clipboard.
To do this, go to System Preferences Keyboard Shortcuts Services, find your service in the list and give it your chosen keyboard shortcut.