Need some basic terminal commands...

Joined
Jul 10, 2007
Messages
1
Reaction score
0
Points
1
I did a bunch of Google-ing and came up with nothing. I'm using my Macbook to connect to a remote iMac G3 server via an SSH tunnel. I'm trying to figure out two commands and I've had no luck finding them:

1. How can I download a certain folder from the remote server to a specified location on my computer?

2. How can I command the server to download a file from the internet to a specified location on that server?

Thanks in advance for the help :)
 

Del


Joined
Dec 24, 2006
Messages
901
Reaction score
15
Points
18
Location
N. Ireland
Your Mac's Specs
Mac Pro 2xQuad core 2.8GHZ
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
2. Typically you cd to the directory of interest and you a tool such as ftp, curl, sftp. One of these command line tools should do. Afterall, you are getting a terminal connection on the server when you ssh into it.

1. I'd tar and compress the directory content to /tmp and download that via sftp to your local box.

A more complicated method to place a friendly face on things is to set up some Appletalk networking when you set up an ssh connection. It involves rerouting port numbers via your ssh command. The server also needs to be sharing Appletalk connections. You then could make a connection to the remote Mac via the Finder and drag&drop files. Some primitive note I have shows me the following connection line. I'm not sure how accurate my notes are as they are from December of 2004.

ssh -4 -L 9548:192.168.1.240:548 remoteservername.com

- 4 is forcing ip4 addressing.
- L is the binding instructions to follow.
- 9548 is the local port you will use to connect to.
- 192.168.1.240 is the real internal address on the remote machine I think.
- 548 is the remote port of the service of interest.
- remoteservername.com is the internet name or address.

Then in Finder type Command-K and enter "afp://localhost:9548/" into the server address field, excluding the quotes of course.
 
D

danielb

Guest
If you are using ssh, you can use the scp (secure copy) command to copy between the machines. Just man scp from the terminal. It should tell you what you need to know.

An example: to copy foo from your home directory on the remote server to the pwd on the local machine use -

"scp -r username@server_ip_address:foo ." You'll be prompted for you ssh password for the remote server.

Hope this helps
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top