How To Use File Transfer Protocol In Linux - Computers

FTP or file transfer protocol is a client/server protocol allowing people to move files to and from a network server. It works with TCP and is widely used on internet. FTP was developed by the University of California, Berkeley for inclusion in 4.2BSD. Any computer running FTP software or ftp demon or ftpd can be accessed and file transfers made. There can be private or public ftp servers. Many public ftp sites which allow access anonymously can be found in internet mostly free Unix or Linux repositories. Private ftp sites require a user name or password. With the help of a ftp client we can access the ftp server. Some of them work in text mode and some are graphical. The standard ftp program is the original ftp client and it comes with most of the linux distributions.

Running the ftp program

$ ftp test.expertslogin.edu

Alternatively we can get the ftp prompt and from there login to the desired ftp site with OPEN command as follows:

$ ftp

ftp> open test.expertslogin.edu

This will ask you for login where pressing ENTER will log you in as local computer user, else you can login as anonymous or ftp user for accessing the public archive. With a valid username we can login into private area as well. While logging as anonymous or ftp user it will ask for an email address as password. On successful login system type and transfer mode are displayed ,

eg:-

Remote system type is UNIX.

Using binary mode to transfer files.

ftp>

There are Binary as well as ASCII file transfer types former transfers file bit by bit and the latter as text. We can switch between types by keying in ascii or binary. Linux commands like ls or cd work from inside ftp. Now to download a file we can use get command

ftp> get linux2.4.13.tar.gz

To save it as a different file we can run :

ftp> get linux2.4.13.tar.gz foo.tar.gz

To download more than one file at a time we can use mget(multiple get) command with a list of filenames delimited with space or wildcards representing the cateogry of the files which are to be downloaded.

ftp> mget linux*

To upload files first change to the /incoming directory and we have the put command which works similar to get command , also we have the mput to upload multiple files simultaneously.

ftp> put foo.tar.gz

To change the local directory we have the command lcd

ftp> lcd /home/foo/

We can use the bang(!) prefix to run local system commands, but !cd command doesn't work and that is why we have lcd command

ftp> !ls

We have the hash and tick command to check the status of file transfers. Besides there are other commands like mkdir, delete, rmdir, chmod which has got the usual meanings but can be run only if we have the right permissions. FTP Servers FTP server is executed from inetd (the internet superserver daemon). Standard ftp port is 21. FTP server uses a standard system call to check the user name and password against the entries in the system password file, or the NIS tables if you are using NIS. Anonymous FTP gives access to a chrooted directory tree only.





iAutoblog the premier autoblogger software