Help Save Code2care! ๐Ÿ˜ข

I've lost 99% of my revenue to AdBlockers & AI. Your support could be the lifeline that keeps this passion project alive!

Buy Code2care a Coffee QR Code

Scan to Buy Me A Coffee and help me continue coding for you!

How to find path of file on Mac Terminal


If you are using the Terminal app on the Mac and want to know what is your current path, well all you need to do is run the pwd command.

The pwd command returns the working directory name.

Example:
    % pwd
    /usr/local/bin
    % pwd
    /Users/c2ctech/Desktop/python

    As you would see in the above examples, just by typing pwd on the Terminal prompt you get the path as a response which you can copy to the clipboard.

Make use of man pwd command to know more about this command.

Mac Terminal Current Directory Path Example using pwd Command

It is important to know a few Mac Terminal commands that are used together with pwd.

  1. cd: The change directory command to move between directories.
  2. ls: To list the files & subdirectories within the current directory.
  3. find: walk a file hierarchy

You can download this article in various formats for your convenience. Choose from the options below:

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

Author Info:

Rakesh (He/Him) has a Masters Degree in Computer Science with over 15+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright Code2care ยฉ 2024 | Privacy Policy | About Us | Contact Us | Search