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
-




Have Questions? Post them here!