How To Upload File Ftp Linux
How to use the Linux ftp command to upwardly- and download files on the trounce
On this page
- Step 1: Establishing an FTP connexion
- Pace 2: Login with User and Countersign
- Step iii: Working with Directories
- Listing directories with security settings:
- Changing Directories:
- Step 4: Downloading files with FTP
- Stride 5: Uploading Files with FTP
- Step half dozen: Endmost the FTP connectedness
In this tutorial, I will explicate how to utilise the Linux ftp control on the shell. I will prove you how to connect to an FTP server, up- and download files and create directories. While there are many nice desktops FTP clients available, the FTP control is still useful when you work remotely on a server over an SSH session and e.g. want to fetch a backup file from your FTP storage.
Stride 1: Establishing an FTP connection
To connect to the FTP server, we accept to type in the terminal window 'ftp' and and so the domain name 'domain.com' or IP address of the FTP server.
Examples:
ftp domain.com
ftp 192.168.0.1
ftp [email protected]
Note: for this example nosotros used an bearding server.
Supercede the IP and domain in the above examples with the IP address or domain of your FTP server.
Step 2: Login with User and Password
Most FTP servers logins are password protected, then the server will inquire us for a 'username' and a 'countersign'.
If you lot connect to a so-called anonymous FTP server, then effort to use "anonymous" as username and an empty password:
Name: anonymous
Password:
The last will return a bulletin like this:
230 Login successful.
Remote system type is UNIX.
Using binary manner to transfer files.
ftp>
When you are logged in successfully.
Step three: Working with Directories
The commands to list, motility and create folders on an FTP server are nigh the same as we would utilize the shell locally on our computer, ls stands for list, cd to change directories, mkdir to create directories...
Listing directories with security settings:
ftp> ls
The server will return:
200 PORT command successful. Consider using PASV.
150 Hither comes the directory listing.
directory listing
....
....
226 Directory send OK.
Changing Directories:
To change the directory nosotros can type:
ftp> cd directory
The server will return:
250 Directory succesfully inverse.
Pace four: Downloading files with FTP
Before downloading a file, we should set the local FTP file download directory by using 'lcd' control:
lcd /home/user/yourdirectoryname
If you dont specify the download directory, the file will be downloaded to the current directory where you were at the time you started the FTP session.
At present, we can use the control 'get' command to download a file, the usage is:
get file
The file will be downloaded to the directory previously set with the 'lcd' command.
The server will render the next bulletin:
local: file remote: file
200 PORT control successful. Consider using PASV.
150 Opening BINARY manner data connexion for file (xxx bytes).
226 File send OK.
XXX bytes received in x.xx secs (ten.xxx MB/s).
To download several files we can utilize wildcards. In this example, I will download all files with the .xls file extension.
mget *.xls
Pace 5: Uploading Files with FTP
We can upload files that are in the local directory where we made the FTP connectedness.
To upload a file, we tin utilise 'put' command.
put file
When the file that you desire to upload is non in the local directory, you tin can use the accented path starting with "/" as well:
put /path/file
To upload several files we tin can utilise the mput command like to the mget example from in a higher place:
mput *.xls
Step 6: Closing the FTP connection
Once we have done the FTP work, nosotros should close the connection for security reasons. There are three commands that we can employ to close the connexion:
bye
exit
quit
Any of them will disconnect our PC from the FTP server and will return:
221 Bye
If y'all demand some additional help, once you are connected to the FTP server, type 'help' and this will testify you all the bachelor FTP commands.
Suggested manufactures
This feature is only available to subscribers. Become your subscription here.
Source: https://www.howtoforge.com/tutorial/how-to-use-ftp-on-the-linux-shell/
Posted by: burdettthety1995.blogspot.com
0 Response to "How To Upload File Ftp Linux"
Post a Comment