How to Copy full Absolute Path of a File on Mac

There are a few ways that I know you can copy the absolute path of a file on a Mac,

1. Using the Terminal and realpath command

% realpath key.pem 

As you can see the realpath command followed by the file name gives you the full absolute path of the file along with the file name and extension.

You can make use of the pwd - present working directory command if you want to know the complete path of a directory.

Copy File Absolute Path on Mac

2. Using the Mouse and Keyboard

  1. Right-Click (Doble-tap or Trackpad if on Macbook) on the file,
  2. Now as you see the Menu press Option ⌥ Key on your Mac Keyboard,
  3. Instead of Copy option you should see "Copy filename as Pathname"
  4. While holding the Option key select the Copy filename as Pathname option,
  5. The absolute path will get copied on the Clipboard

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap