Corso di Informatica - Internet - Esempi FTP


Esempio di sessione FTP

 

Nell'esempio che segue

La stringa "arf@ARF_HOME:~$" che appare all'inizio ed alla fine dei due esempi rappresenta il prompt del sistema utilizzato per produrre questi esempi.

 

A titolo di esempio un paio di siti ftp che ospitano, per l'appunto, due diversi client ftp. Abbiamo riportato due esempi per mostrare le lievi differenze che ci possono essere fra un sito e l'altro. Nella fattispecie i due esempi si riferiscono a siti gestiti mediante una macchina Windows NT ed una Unix rispettivamente. Questi esempi servono anche a dare un'idea dell'interazione con il computer basata sui comandi, oggi largamente soppiantata da interfacce grafiche di ogni tipo. Indubbiamente, l'impiego di comandi da battere è assai meno attraente e intuitivo dell'interazione grafica. Tuttavia, senza voler togliere nulla ai vantaggi delle interfacce grafiche, può essere utile avere un po' di dimestichezza con i tradizionali comandi che, in certi casi, si possono anche rivelare più idonei a svolgere certi compiti, specialmente in sistemi basati sul sistema operativo Unix.

 

arf@ARF_HOME:~$ ftp ftp.ftpx.com
Connected to ftp.ftpx.com.
220 ns Microsoft FTP Service (Version 5.0).
Name (ftp.ftpx.com:arf):
anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
Password:
arf@unifi.it
230 Anonymous user logged in.
Remote system type is Windows_NT.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
02-08-02 07:48AM <DIR> pub
226 Transfer complete.
ftp>
cd pub
250 CWD command successful.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
02-08-02 07:48AM <DIR> ftpx
226 Transfer complete.
ftp>
cd ftpx
250 CWD command successful.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
12-24-00 12:00AM 31209 dan-res.zip
12-24-00 12:00AM 30980 dut-res.zip
12-24-00 12:00AM 30723 esp-res.zip
12-24-00 12:00AM 31506 fr-res.zip
12-18-00 12:00AM 677481 ftpx.zip
12-24-00 12:00AM 31664 ger-res.zip
12-24-00 12:00AM 374198 helpfile.zip
12-24-00 12:00AM 5803 inetwh16.zip
12-24-00 12:00AM 30116 ita-res.zip
12-24-00 12:00AM 31380 jpn-res.zip
12-24-00 12:00AM 30041 nor-res.zip
12-24-00 12:00AM 30121 rom-res.zip
12-24-00 12:00AM 31020 sec-res.zip
226 Transfer complete.
ftp>
quit
221
arf@ARF_HOME:~$
arf@ARF_HOME:~$ ftp gftp.seul.org
Connected to moria.seul.org.
220 moria.mit.edu FTP server (Version wu-2.6.2-5) ready.
Name (gftp.seul.org:arf):
anonymous 331 Guest login ok, send your complete e-mail address as password.
Password:
arf@unifi.it
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for directory listing.
total 32
d--x--x--x 2 root root 4096 Dec 5 2002 bin
d--x--x--x 2 root root 4096 Dec 5 2002 etc
drwxr-xr-x 2 root root 4096 Dec 5 2002 lib
drwxr-xr-x 43 root 50 4096 Jan 3 01:40 pub
226 Transfer complete.
ftp>
cd pub
250 CWD command successful.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for directory listing.
total 336
drwxrwxr-x 2 772 50 4096 Jan 6 2002 3dplanetarium
drwxr-xr-x 2 627 50 4096 Nov 30 1999 august
drwxr-xr-x 2 641 50 4096 Nov 19 1999 casts
drwxr-xr-x 4 root 50 4096 Dec 5 2002 chess
drwxr-xr-x 2 648 50 4096 Jan 6 2002 collector
drwxr-xr-x 2 616 50 4096 Aug 25 1999 ddial
drwxr-xr-x 2 593 50 4096 Sep 17 2000 ebook
drwxr-xr-x 3 639 50 8192 Dec 16 2002 ecasound
drwxr-xr-x 2 621 50 4096 Aug 25 1999 ewave
drwxr-xr-x 4 697 50 4096 Jun 25 2002 f-cpu
drwxrwxr-x 2 727 727 4096 Nov 2 2002 fcron
drwxr-xr-x 4 671 50 4096 Apr 18 2001 gbib
drwxr-xr-x 2 723 50 4096 Dec 16 2002 gdis
drwxr-xr-x 6 525 525 4096 Dec 5 2002 geda
drwxrwxr-x 4 602 602 4096 Dec 10 2002 gftp
drwxrwxr-x 3 500 50 4096 Feb 3 22:22 glue
drwxrwxr-x 2 765 50 4096 Dec 10 2001 gpldiveplanner
drwxrwxr-x 4 619 618 4096 Dec 11 2002 gps
drwxr-xr-x 2 604 50 4096 Jul 11 1999 gtc
drwxr-xr-x 2 609 50 4096 Aug 5 2002 gtkpool
drwxr-xr-x 2 588 50 4096 Jun 22 1999 gtuner
drwxr-xr-x 2 653 50 4096 May 19 2002 iptraf
drwxr-xr-x 2 747 50 4096 Aug 26 2001 isl
drwxr-xr-x 2 659 50 4096 Feb 14 2000 kangband
drwxr-xr-x 2 636 50 4096 Nov 1 1999 kugel
drwxr-xr-x 2 648 50 4096 May 21 2001 palstuff
drwxrwxr-x 6 631 50 4096 Mar 1 15:26 pingus
drwxrwxr-x 6 694 50 4096 Dec 24 19:23 pygame
drwxr-xr-x 2 623 50 4096 Sep 6 1999 roster
drwxr-xr-x 2 596 50 4096 Jan 6 2000 settlers
drwxr-xr-x 3 500 50 4096 Dec 16 2002 seul
drwxr-xr-x 2 669 50 4096 Mar 8 2000 snac
drwxrwxr-x 2 773 50 4096 Jan 11 2002 sumtimes
drwxrwxr-x 9 732 50 4096 Dec 16 2001 tiny
drwxr-xr-x 2 655 50 4096 Mar 4 2000 tpm
drwxrwxr-x 10 715 93 4096 May 26 2001 worldforge
drwxrwxr-x 3 534 50 4096 Jan 3 10:29 wxftp
drwxr-xr-x 3 625 50 4096 Jan 9 2002 xarchon
drwxr-xr-x 2 629 50 4096 Sep 14 1999 xlhtml
drwxr-xr-x 2 696 50 4096 Nov 16 2000 xpenguins
drwxrwxr-x 2 619 618 4096 Dec 11 2002 yawmppp
226 Transfer complete.
ftp>
cd gftp
250 CWD command successful.
ftp>
ls
200 PORT command successful.
150 Opening ASCII mode data connection for directory listing.
total 8616
-rw-rw-r-- 1 603 602 464 Dec 10 2002 MD5SUMS
-rw-r--r-- 1 603 602 630748 Dec 10 2002 gftp-2.0.14-1.i386.rpm
-rw-r--r-- 1 603 602 1147527 Dec 10 2002 gftp-2.0.14-1.src.rpm
-rw-rw-r-- 1 603 602 784470 Dec 10 2002 gftp-2.0.14.tar.bz2
-rw-rw-r-- 1 603 602 1136930 Dec 10 2002 gftp-2.0.14.tar.gz
-rw-r--r-- 1 603 602 314156 Dec 10 2002 gftp-common_2.0.14-1_i386.deb
-rw-r--r-- 1 603 602 224056 Dec 10 2002 gftp-gtk_2.0.14-1_i386.deb
-rw-r--r-- 1 603 602 74660 Dec 10 2002 gftp-text_2.0.14-1_i386.deb
-rw-r--r-- 1 603 602 43300 Dec 10 2002 gftp_2.0.14-1_i386.deb
drwxrwxr-x 2 602 602 4096 Nov 23 2001 libs
drwxrwxr-x 2 602 602 4096 Dec 10 2002 old-releases
226 Transfer complete.
ftp>
quit
221-You have transferred 0 bytes in 0 files.
221-Total traffic for this session was 775 bytes in 0 transfers.
221-Thank you for using the FTP service on moria.mit.edu.
221 Goodbye.
arf@ARF_HOME:~$

Le sessioni che abbiamo riportato sono esempi di sessioni di "orientamento" nelle quali ci si limita a dare un'occhiata al contenuto. Non contengono comandi di trasferimento i principali dei quali sono get per fare il download di un file e put per fare lo upload di un file. Sono molto semplici da usare. Per trasferire per esempio il file di nome "pippo" dal proprio computer al sito ftp basta digitare "put pippo" mentre per trasferire lo stesso file dal sito ftp al proprio computer "get pippo".

E' possibile inoltre avere informazioni sui vari comandi digitando help al prompt della sessione ftp. Per avere aiuto riguardo ad un particolare comando, get per esempio, digitare "help get".