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?
It would depend on how you want to access the file. Here's what I do:
- 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
- Connect to the shared folder/volume available to your user
- 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:
- Open Finder, connect to the server/volume (Steps 1+2 above)
- Run Command+F to Find, enter your search term
- Above the Finder section where files display, switch the search to "Shared" - this will run the search against connected volumes
- Locate the file you want, and then drag+drop it into an open Terminal window
- The path will be shown in Terminal
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.