what is the ftp command to download file
FTP Command :
In my previous commodity i take explained about the Ping command of unix/linux with dissimilar examples. In this article i will try to explain the FTP Command in unix in detail with existent examples in solar day to mean solar day life.FTP stands for File transfer protocol which is used to transfer the file from 1 server to another server location.FTP command is so useful equally it allows you to store and retrieve files from any calculator in the world.There are 2 types of FTP :
ane.FTP : which is a simple File Transfer Protocol
2.SFTP:which is Secured File Transfer Protocol
FTP is most preferred protocol for information transfer among the computers.
Post-obit are different usages of FTP :
ane.Log in and establishing connection with the remote host computer.
2.Upload the Files
3.Download the Files.
4.Navigating through the unlike directorties
v.Browsing contents through directories.
I will explain the different usages of FTP Command with real globe examples.The FTP commands are applicable to SFTP also and so wherever FTP is mentioned user can use that same commands for SFTP also.
Example 1 : Connecting to the FTP Server
The basic question is how to connect to FTP server.You can open up the connexion with the remote host with using the IP of target PC or hostname of the PC. To check the hostname of the PC post-obit control is used :
Example :
$hostname
Output :
PC102323
User can use 2 unlike commands to connect through FTP server.
Syntax :
Command one :
$FTP IP/Hostname
Example:
$FTP 10.20.208.110
User can directly connect through the FTP command using the Hostname or IP address.
Command ii :
$FTP
ftp>Open IP/Hostname
User tin can connect to FTP server and so utilize open command to connect with the FTP server.The server volition ask the username and password while connecting to the server.
Example two :Downloading File using FTP :
After connecting to FTP server the question is how to download the file in FTP.When user connect to the FTP server the set of commands need to employ for different operations.To download the file from FTP server the GET command is used.
There are 2 modes available to download the file. Ane is Binary mode (for non-text files) and ascii mode (for text files).
Example :
To download the file and save it with another proper name.The File named complexsql.html is saved as complexsql1.html.
Change mode to ASCII:
ftp>ascii
ftp> go compexsql.html complexsql1.html Fetching /home/complexsql.html to complexsql1.html /home/complexsql.html
Instance three: Change the FTP mode to ASCII to Binary mode to transfer not-text file.
When user needs to download the non text files then there is need modify the mode from ASCII mode to binary style..
ftp> binary 200 Type set to I.
Instance four:Upload the file to FTP Server
User needs to use the PUT command to upload the file to FTP server.
Example:
ftp> put filename ftp> put complexsql.html
Example five: Listing all files in FTP server
You can view all the files and directories of FTP server using ls command.
Example:
ftp>ls
It volition list all files on ftp server.
Example 6: Help Control
If you desire to check the different FTP commands just connect to FTP server and use aid command or ? command to check different FTP commands.
Syntax :
ftp > Help Command Name
Example:
ftp> Help Put
The higher up control will bear witness the Put command help.
Example 7: Irresolute directory using cd Command
Just like a simple unix control of changing directory.User can alter the directory using cd command.There are 2 directories one is remote directory and other directory is local directory.
ftp> pwd
"/dwelling house" is current directory.
ftp> cd directory1
CWD command successful.
"/home/directory1" is electric current directory.
ftp> pwd 257
"/dwelling house/directory1" is current directory.
Case 8 : Alter local directory with using lcd command
User can use lcd command to modify local directory.
Note :
- Crush : executing! takes you to the shell.
- FTP Prompt : prompt starts withftp> is ftp prompt.
- Shell Prompt : prompt starts with$is beat out command line.
ftp> !
$ pwd /home/Amiet/
FTP $ exit exit
ftp> lcd /tmp Local directory now /tmp
ftp> !
$ pwd
/tmp
Example nine : Downloading multiple files
User tin download the multiple files using the mget command.User can apply the globs to download multiple files.
Example :
If user want to download all jpg files from ftp server then use mget with * .
ftp> mget *.jpg
The in a higher place command will download all the jpg files from remote server. After downloading the files if user wants to show the files which are downloaded and so use mls command every bit follows :
ftp> mls.jpg
Example 10 : Uploading multiple files
User tin upload the multiple files using mput command of FTP.The mput control works similar to mget control.
Example :
Following command will upload all the jpg files from local server to remote server.
ftp> mput *.jpg
Example eleven : Close FTP connection
Afterwards opening the FTP connection user needs to shut information technology to connect with another connection.User needs to employ the close command to close FTP connection.
ftp> open ftp.complexsql.com
Already connected to complexsql.com, employ close first.
ftp> close
221 Goodbye.
ftp> open ftp.anonymous.com
These are some of import examples of FTP command which are very useful in our solar day to day life.Kindly comment in comment section if you have whatsoever suggestions.
campbellmepheculd.blogspot.com
Source: https://www.complexsql.com/ftp-command/
0 Response to "what is the ftp command to download file"
إرسال تعليق