How to Copy a File Path on Windows, Mac, and Linux
Knowing how to copy a file path is one of those small skills that quietly saves a lot of time. Whether you're pasting a location into a terminal, sharing a file reference with a colleague, or troubleshooting a software configuration, having the exact path on your clipboard — formatted correctly — matters more than most people realize until something breaks.
What Is a File Path?
A file path is the unique address of a file or folder on a storage system. It tells the operating system exactly where to find something by listing every directory in the hierarchy, from the root down to the file itself.
Paths come in two main forms:
- Absolute paths — start from the root of the drive (e.g.,
C:UsersJordanDocuments eport.pdfon Windows, or/home/jordan/documents/report.pdfon Linux) - Relative paths — start from a current working directory and only describe the remaining steps to the target
For most everyday copy-paste tasks, you'll want the absolute path.
One thing that trips people up immediately: path syntax differs by operating system. Windows uses backslashes (), while macOS and Linux use forward slashes (/). If you copy a path from a Windows machine and paste it into a Linux terminal, it won't work as-is. Keeping that difference in mind saves a lot of head-scratching.
How to Copy a File Path on Windows 🖥️
Windows offers several methods depending on your version and comfort level.
Using File Explorer (Shift + Right-Click)
- Open File Explorer and navigate to the file or folder
- Hold Shift, then right-click the item
- Select "Copy as path" from the context menu
- Paste anywhere — the path appears in quotes, like
"C:UsersJordanDocuments eport.pdf"
The quotes are included automatically, which is actually useful when a path contains spaces. Most command-line tools handle quoted paths correctly.
Using the Address Bar
- Navigate to the folder in File Explorer
- Click directly on the address bar at the top — the display switches from breadcrumb view to the full plain-text path
- Press Ctrl + A to select all, then Ctrl + C to copy
This method gives you the folder path without quotes.
Using PowerShell or Command Prompt
If you're already in a terminal, you can right-click on a file and copy the path from its properties, or use commands like pwd (PowerShell) to print the current working directory, then copy the output manually.
How to Copy a File Path on macOS 🍎
Mac handles paths a little differently because Finder doesn't show full paths by default.
Using Finder with Right-Click
- Right-click (or Control-click) the file in Finder
- Hold the Option key — the context menu updates in real time
- "Copy [filename]" changes to "Copy [filename] as Pathname"
- Select that option to copy the full Unix-style path (e.g.,
/Users/jordan/Documents/report.pdf)
Using the Get Info Window
- Right-click the file and choose Get Info
- The "Where" field shows the folder path — not the full file path, but close
- This method is more useful for locating a folder than copying a precise path
Using Terminal
If you're comfortable with the command line, drag and drop a file directly into a Terminal window. macOS automatically expands it into the full file path, which you can then select and copy.
How to Copy a File Path on Linux
Linux users generally work closer to the command line, so copying paths is often done inside a terminal:
pwdprints the current directory's absolute pathreadlink -f filenameresolves and prints the full absolute path of any file, including symlinks- Right-clicking in most graphical file managers (Nautilus, Thunar, Dolphin) offers a "Copy Location" or "Properties" option that exposes the path
The exact option name varies by desktop environment and distro, so it's worth checking your file manager's right-click menu once to know what's available on your specific setup.
Why the Method You Use Actually Matters
| Scenario | What You Need |
|---|---|
| Pasting into a command line | Unquoted path, correct slash direction for the OS |
| Sharing a file location with a colleague | Absolute path, ideally with the drive or root explicit |
| Referencing a file in a config or script | Path format must match the OS the script runs on |
| Moving between Windows and WSL | Windows paths need conversion (e.g., C: becomes /mnt/c/) |
Getting the right format for the right context is where things go wrong most often. A path copied from Windows Explorer (with backslashes and quotation marks) pasted into a Python script on the same machine may need the quotes stripped or the backslashes escaped.
Variables That Affect Which Method Works for You
A few things shape which approach actually fits your situation:
- Operating system version — older versions of Windows (pre-Windows 10) don't have "Copy as path" in the standard right-click menu; Shift + right-click was the workaround
- Whether you're using a GUI or command line — terminal users and GUI users reach the same result through very different paths
- What you're doing with the path — pasting into a chat is different from inserting it into code or a config file
- Network vs. local paths — shared network locations use UNC paths (
\serversharefile) on Windows, which behave differently from local drive paths
The method that works cleanly for one workflow may produce an incorrectly formatted result in another — and the fix is usually just knowing which variation to choose before you copy.