Get the full path on Terminal by dragging a folder/file into it – Mac OS X

While working on terminal, we can quickly get the full path of any finder item on terminal. This is really useful in several cases, for example, when we are renaming & moving a file using mv command, we need to provide the full path of the original folder. By just dragging a folder into terminal we can get the full path on terminal.

Steps are as follows:

  1. Open Terminal. To open press CommandSpace , type terminal and hit enter.
  2. Open Finder window and locate the file/folder for which you need the full path. Drag the file/folder to the terminal. This will copy the full path of that file/folder on terminal as shown in the screenshot below.

    Dragging the file into the terminal:
    Dragging folder to terminal
    Full path on terminal:
    Full path on terminal after dragging folder