domenikos@emass.enet.dec.com (George Domenikos.) (03/21/91)
Can someone tell me what the exact syntax is in using anonymous FTP to a given pathname? Please provide an example if you can. thanks George
lrm3@ellis.uchicago.edu (Lawrence Reed Miller) (03/21/91)
In article <4178@ryn.mro4.dec.com> domenikos@emass.enet.dec.com (George Domenikos.) writes: > >Can someone tell me what the exact syntax is in using anonymous FTP >to a given pathname? Please provide an example if you can. > >thanks > >George Sure. This is an example of ftp'ing to the archive site sumex-aim.stanford.edu. The syntax on your system might vary slightly, but you will still have all of the same prompts & responses. Note that at the Password: prompt you are supposed to type in user@host; this is not echoed back. In this example I log in as anonymous. ftp sumex-aim.stanford.edu anonymous Type in my username at lars@spurtle.rh.uchicago.edu the Password: prompt (not echoed). List the directory (-C ls -C is for nice formatting just like in unix. ls with no modifier also works). Move to the info-mac cd info-mac directory (like unix) List it... ls -C Retrive a file in the get 00readme.txt current directory in ascii mode (text or hqx should go in ascii mode). Quit ftp. quit In the following commands, "directory" and "filname" are the name of a file or directory.. To switch between ascii mode and binary mode (for .Z files, .Bin, etc) you can type "binary" or "ascii" at the ftp> prompt. By default files that you get will go into your home directory. The command "lcd directory" will change your directory so that files that you get will go there. "!ls" will list your local directory (in fact, !command will execute any unix command on your own machine while in ftp). To send files (not used much in anonymous ftp) use "put filename". Type "man ftp" from the UNIX command prompt for more info on ftp. Beginning of example----------------------------------------- spurtle.lars 2 # ftp sumex-aim.stanford.edu Connected to sumex-aim.stanford.edu. 220 sumex-aim FTP server (SunOS 4.0/3) ready. Name (sumex-aim.stanford.edu:lars): anonymous 331 Guest login ok, send mail address (user@host) as password. Password: 230 Guest connection 17 (of 25) accepted, access restrictions apply. ftp> ls -C 200 PORT command successful. 150 ASCII data connection for /bin/ls (128.135.100.31,1069). allegro122.sit.hqx.crypt info-mac bin pid etc pub imap tmycin 226 ASCII Transfer complete. remote: -C 75 bytes received in 5e-06 seconds (1.5e+04 Kbytes/s) ftp> cd info-mac 250 CWD command successful. ftp> ls -C 200 PORT command successful. 150 ASCII data connection for /bin/ls (128.135.100.31,1070). 00readme.txt cdev fkey lang tech app comm font misc tips apple da game report unix art demo help sound util card digest init source virus 226 ASCII Transfer complete. remote: -C 162 bytes received in 0.033 seconds (4.7 Kbytes/s) ftp> get 00readme.txt 200 PORT command successful. 150 ASCII data connection for 00readme.txt (128.135.100.31,1071) (976 bytes). 226 ASCII Transfer complete. local: 00readme.txt remote: 00readme.txt 999 bytes received in 0.27 seconds (3.7 Kbytes/s) ftp> quit 221 Goodbye. spurtle.lars 3 # End Example-------------------------------------------------- Hope this helps. If you have any questions, feel free to email me. Lawrence Miller