How to Use FTP Unix Command

In this tutorial we will show you how to Use the ftp unix command. Ftp; that stands for File Transfer Protocol, is a protocol that allows the transfer or receiving of files from a host to the other. This can be done through a network like the internet.
To understand more about the unix ftp commands follow the tutorial steps given below.



Step 1 – Type the command
First of all in the terminal, let’s type the command ftp space followed by the internet address you want to access.
Enter the command

Step 2 – Type the username and password
With that done, it will prompt you to type the user name which is provided by the ftp server administrator. Once you have typed in the username, you will be required to type the password as well.
Enter the username and password

Step 3– List the directory contents
With that done, a connection would be successfully established. Now let’s list the contents of the directory over here.
List the contents of the directory

Step 4 – Retrieve file from server
If you want to receive the file from the server, type the command “mget” followed by the file name you want to retrieve”.
Receive file from server

Step 5 – Confirm to retrieve file
With that done, it will ask for a confirmation whether you want to retrieve the selected file. Over here, type yes and hit enter to continue. This will get the file form the server and place it in the root directory.
Press “yes” to retrieve file

Step 6 – Transfer file from root directory to ftp server
If you want to transfer the file from your root directory to your ftp server, you can use the command “put” followed by the name of the file you want to transfer.
Transfer file

Step 7– List contents of directory again to view transferred file
Now when we list the contents of the directory in our ftp server, you can see that the file has been successfully transferred.
View the directory to see the transferred file

Step 8– Rename a file on ftp server
If you want to rename a file which is on your ftp server, you can use the ftp unix command “rename” followed by the name of the file you want to rename. After that, you will be required to type in the new name you want to keep for the file.
Rename a file on the server

Step 9 – List directory to view renamed file
Now when we list the contents of the directory in our ftp server, you can see over here that the file has been successfully renamed.
List the directory contents to see the renamed file

Step 10 – Delete file from ftp server
If you want to delete the file from the ftp server, type the command “delete” followed by the name of the file you want to delete.
Remove file from server

Step 11– View directory to see if file has been deleted
If we list the contents of the directory right now, you will notice that the file has been successfully deleted.
View the directory contents

Step 12 – Close ftp session
To logout and end the ftp session, simply type “bye” and hit enter.
With that done, the session will be closed. And that’s it, follow the steps given above to learn about the unix ftp commands that are used in such and ftp session.
End the ftp session