The FTP(file transfer protocol) is the command utility that is utilized to exchange files over the network. It establishes a connection between remote systems and transfers files and directories in a secure way.
This article will describe the working of the “ftp” command to transfer single or multiple files.
The supported content of this tutorial is as follows:
- Prerequisite: Install FTP Package
- Transfer a File From Remote System
- Transfer Multiple Files From Remote System
Let’s start with the prerequisites.
Prerequisite: Install FTP Package
It is a prerequisite step to install the ftp required package for transferring files over the network. To do so, follow the below script with the “sudo” privilege:
$ sudo apt install vsftpd
After executing the above command, all dependent files are installed to start the services of ftp.
Check FTP Connection to Remote System
To establish the FTP connection with the remote system, the IP address of the remote server or domain name is required for transferring files. To do so, the “ftp” command is utilized, specifying the IP address:
$ ftp 192.168.157.134
The output establishes the connection to the remote system “roger” for transferring files after spend navigates to the “ftp” prompt.
How to Transfer a File From a Remote System?
For transferring a file “file.txt”, use the “get” command. This command accesses the remote system and gets the required file from the remote system.
> get file.txt
The output shows that the “file.txt” has been successfully transferred.
How to Transfer Multiple Files From the Remote System?
In the “ftp” prompt environment, administrators can transfer multiple files from the remote system by specifying the name of the files with the extension as below:
> get file.txt cat.txt
The output confirms that “file.txt” and “cat.txt” has been transferred successfully.
That is all from transferring files.
Conclusion
In Linux, the “ftp” command transfers files between remote systems. After establishing a connection through the “ftp <remote-system IP Address>” command, users can transfer single or multiple files from the local system to the remote server. This article has explained all possible examples of transferring files using the “ftp” command in Linux.