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 Enter the command](https://howtech.tv/wp-content/images/003473/01.jpg)
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 Enter the username and password](https://howtech.tv/wp-content/images/003473/02.jpg)
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 List the contents of the directory](https://howtech.tv/wp-content/images/003473/03.jpg)
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 Receive file from server](https://howtech.tv/wp-content/images/003473/04.jpg)
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 Press “yes” to retrieve file](https://howtech.tv/wp-content/images/003473/05.jpg)
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 Transfer file](https://howtech.tv/wp-content/images/003473/06.jpg)
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 View the directory to see the transferred file](https://howtech.tv/wp-content/images/003473/07.jpg)
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 Rename a file on the server](https://howtech.tv/wp-content/images/003473/08.jpg)
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 List the directory contents to see the renamed file](https://howtech.tv/wp-content/images/003473/09.jpg)
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 Remove file from server](https://howtech.tv/wp-content/images/003473/10.jpg)
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 View the directory contents](https://howtech.tv/wp-content/images/003473/11.jpg)
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 End the ftp session](https://howtech.tv/wp-content/images/003473/12.jpg)