How to Copy a File Path on Windows, Mac, and More
Copying a file path sounds simple — and it is, once you know where to look. But the method varies significantly depending on your operating system, how you're navigating your files, and what you actually plan to do with the path once you have it. Here's a clear breakdown of how it works across different environments.
What Is a File Path?
A file path is the unique address that tells your computer exactly where a file or folder lives on a storage system. It's a string of text that traces the route from a root location down through directories to the specific file.
There are two main types:
- Absolute path — the full address from the root of the drive (e.g.,
C:UsersJaneDocuments eport.docxon Windows, or/Users/jane/Documents/report.docxon macOS/Linux) - Relative path — a partial address relative to a current working directory (e.g.,
Documents eport.docx)
For most everyday uses — pasting into a terminal, sharing a location with a colleague, or referencing a file in code — you'll want the absolute path.
How to Copy a File Path on Windows
Windows offers several methods depending on how comfortable you are with the interface.
Method 1: Shift + Right-Click in File Explorer
This is the fastest method for most users.
- Open File Explorer and navigate to your file or folder
- Hold Shift on your keyboard and right-click the file
- Select "Copy as path" from the context menu
- Paste it anywhere — the path will appear in quotes (e.g.,
"C:UsersJaneDocuments eport.docx")
💡 On Windows 11, "Copy as path" appears in the right-click context menu without needing to hold Shift — it's been promoted to the top-level menu.
Method 2: Using the Address Bar
- Click on the address bar at the top of File Explorer
- The path will become selectable text
- Press Ctrl + A to select all, then Ctrl + C to copy
This method gives you the path without quotation marks, which is useful for certain applications.
Method 3: Command Prompt or PowerShell
If you're already working in a terminal:
- Navigate to the directory and type
cd— this prints your current path - Use
echo %cd%in Command Prompt or$PWDin PowerShell to display the full working directory path
How to Copy a File Path on macOS
macOS doesn't make this as obvious, but there are reliable methods.
Method 1: Right-Click with Option Key
- In Finder, right-click the file or folder
- Hold the Option key — the menu will change, and "Copy [filename]" will become "Copy [filename] as Pathname"
- Click that option
The copied path will look like: /Users/jane/Documents/report.docx
Method 2: Drag to Terminal
If you have a Terminal window open:
- Type
cd(with a space) in the terminal - Drag the folder from Finder into the Terminal window
- The full path will be auto-inserted
Method 3: Get Info Panel
- Right-click the file and select "Get Info"
- The "Where" field shows the containing folder's path
- You can manually copy this, though it requires adding the filename yourself
How to Copy a File Path on Linux 🐧
On Linux, the method depends on your desktop environment and file manager, but terminals are the most reliable route.
- In Nautilus (GNOME): Press Ctrl + L to reveal the path bar, then copy the text
- In a terminal: Use
pwdto print the working directory, orreadlink -f filenameto get a file's full absolute path - Right-click options vary by distro and file manager — some show a "Copy Location" option natively
Copying File Paths in Specific Applications
Sometimes you need the path from within a program, not from a file manager.
| Context | Method |
|---|---|
| Microsoft Office (Windows) | File → Info → path shown under document title; click to copy |
| VS Code | Right-click file in sidebar → "Copy Path" or "Copy Relative Path" |
| Windows Terminal / PowerShell | (Get-Item .filename.txt).FullName |
| macOS Terminal | realpath filename or echo $(pwd)/filename |
| Python scripts | os.path.abspath('filename') |
Key Variables That Affect Which Method Works Best
The "right" way to copy a file path isn't one-size-fits-all. Several factors shape which approach makes the most sense:
- Operating system version — Windows 10 vs Windows 11, or macOS Ventura vs older versions, differ in where menu options appear
- Whether you're using a GUI or terminal — command-line users have more direct, scriptable options
- Where the path will be pasted — some tools strip quotation marks automatically; others require them or break if they're present
- Path format compatibility — Windows uses backslashes (
) while macOS and Linux use forward slashes (/). This matters a lot if you're sharing paths across systems or writing cross-platform scripts - Network vs local paths — paths on mapped network drives or shared folders may look different from local file paths (e.g., UNC paths like
\serversharefile.txton Windows) - Technical comfort level — keyboard shortcuts and context menu options are faster for casual users; terminal methods offer more precision for developers
When Path Format Actually Matters
For general purposes — pasting a location into a chat message or a basic script — most formats work fine. But certain workflows are more sensitive:
- Spaces in file names can cause issues in terminals unless the path is wrapped in quotes
- Special characters in folder names can break paths in some environments
- Long paths on Windows (over 260 characters) may cause errors unless long path support is enabled in system settings
Understanding your destination — where the path is going and what's going to read it — determines which format and which copy method actually fits the task.