ftp and sftpThe ftp stands for File Transfer Protocol. It connect to the remote host to exchange files and directories from one host to another over a network which can be LAN or any other. The sftp stands for Secure ftp. Most of the ftp commands are applicable to sftp. So wherever, you need to use sftp, you can use it at the place of ftp. ftp promptThe ftp prompt can be used to perform different ftp functions with ftp commands. Syntax: Look at the above snapshot, by passing ftp command we'll be directed into the ftp prompt. Here, we can write ftp commands to perform different functions. ftp helpTo open ftp command or help page from ftp prompt , ? Sign or help command is used. Syntax: Look at the above snapshot, it displays the help page for the ftp which shows all the ftp commands. exiting ftp promptTo exit from ftp prompt, ! Mark is used. It will take you to the shell prompt. Syntax: Look at the above snapshot, using ! will allow you to exist from the ftp prompt. Connect to a ftp siteYou can connect to a particular ftp server using either its IP address or the Hostname from the command line. Syntax: Syntax: Downloading file usingTo download a file from a remote server, use get command. Syntax: To download files, user has to be in correct mode, either binary or ascii mode. In ascii mode, text files can be transferred while in binary mode, all other type of files can be transferred. Saving downloaded file with another nameIf you want to save a downloaded file with another name, following command can be used. Syntax: Example: get pro2356.php project.php Look at the above snapshot, we are downloading a file named as pro2356.php want to save it as project.php Changing ftp modeThere are two modes, one is binary (for all other files) and other is ascii (for text files) mode. To ascii mode To binary mode Uploading file usingTo download a file from a remote server, use put command. Syntax: Listing files in current folderYou can view a remote directory using ls command. Downloading multiple files usingThe mget command is used to fetch multiple files from ftp server. Syntax: Uploading multiple files usingThe mput command is used to upload multiple files from ftp server. Syntax: close commandWhen you want to connect to another server without existing the ftp prompt, close command should be used. Then you can connect to a new server from ftp prompt. Syntax: Next TopicLinux free command |