2

I would like to access files from another computer on the same network in the Terminal. But I am not sure of the path to those files. How do I find it?

3

It would depend on how you want to access the file. Here's what I do:

  1. Initiate the connection to the remote computer (I do it via Finder -> Go -> Connect to Server [or Command+K]) but you can also do via terminal using the mount command
  2. Connect to the shared folder/volume available to your user
  3. When connecting to those in Terminal, you would now use the path /Volumes/[name of folder]/[rest_of_path_here] to access them.

For example, if you connected to a folder called Stuff with a subfolder called Things, and ultimately file jackpot.txt on ip 10.10.1.5, first connect via smb to the server (10.10.1.5), choose the folder Stuff, and then reference that path in Terminal as /Volumes/Stuff/Things/jackpot.txt

EDIT: You can also run a Find command (Command + F) inside of Finder while you are connected to the share if you still don't know where the file is. Do the following:

  1. Open Finder, connect to the server/volume (Steps 1+2 above)
  2. Run Command+F to Find, enter your search term
  3. Above the Finder section where files display, switch the search to "Shared" - this will run the search against connected volumes
  4. Locate the file you want, and then drag+drop it into an open Terminal window
  5. The path will be shown in Terminal
  • 2
    Thanks. Dragging the file to terminal is as easy as it gets. – gdaniel Jun 10 '15 at 21:28
  • @gdaniel Very true :) Figured I'd help also fill in the cracks in case the file was just completely unknown in its location! – smoooosher Jun 10 '15 at 21:34
2

In addition to drag and drop, you can right click on any Finder window, select "Customize Toolbar," and add the "Path" drop-down button.

It won't show a path you can copy-paste like in Windows, but it will give a better idea of the path to a folder you're in.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .