| by Arround The Web | No comments

12 PowerShell FTP Commands

FTP or File Transfer Protocol that transfers the files from a client to a remote host. Genuinely, its core purpose is to transfer files between devices on a computer network running FTP server service.

Quick Outline:

PowerShell FTP Commands

Conclusion

PowerShell FTP Commands

PowerShell allows its users to access the FTP protocol. PowerShell automates the file transfers and quickens file transfers using scripts. FTP has a bunch of other commands for the file transfer management tasks. The FTP commands are available to the computers with TCP/IP protocol installed as a component.

1. FTP

The FTP command with the use of FTP protocol transfers the files from a local host to the remote host. Generally, it is an exchange of files where it sends and receives files on a computer running an FTP server service.

Example:

This example will log on to the specified FTP server:

Ftp <ftp.linuxhint.server.com>

To log on to the server, first, place the FTP command and specify the server address.

2. Append

The Append command appends the text to an existing local file. It appends the text from the local computer file to the file located on the remote server.

Example:

This example will append the first file to file two on the remote server:

Append <textfile1.txt> <textfil2.txt>

To append the text file on the remote server:

  • First, place the append command.
  • Then, specify the file you want to append to another file.
  • After that, specify the file to be appended.

3. Cd

The CD command navigates to the specified directory. To navigate to any directory on the remote server, simply the directory to the CD command.

Example:

This example will change the current directory to the specified directory:

Cd <Where-Directory-will-be-changed>

To navigate to the desired directory, first, place the CD command and then specify the path you want to navigate.

4. Delete

The Delete command deletes a single file on a remote FTP server.

Example:

This example will delete the specified file from the remote server:

Delete <testfile.txt>

To delete a file from the remote server, specify the file to be deleted to the delete command.

5. Mdelete

The Mdelete command deletes more than one file at once on a remote server.

Example:

This example will delete multiple from the remote computer:

Mdelete <file1.txt> <file2.txt>

To delete multiple files from the remote computer, simply specify more than two files to the mdelete command.

6. Send

The Send command sends individual or lists of files from one computer to another remote computer using FTP protocol.

Example:

This example will send the specified files to the remote server:

Send <testfile1.txt> <testfile2.txt>

To send files to the remote server, simply specify the files to the send command.

7. Get

The Get command gets a single file from a remote computer using the FTP protocol.

Example:

This example will retrieve the specified file from the remote server:

Get <testfile.txt>

To get the file from the remote server, specify that file to the Get command.

8. Mget

The Mget command gets multiple files from a remote computer using FTP protocol.

Example:

This example will get multiple files on the remote server:

Mget <file1.exe> <file2.exe>

Specify the files to the Mget command to get them on the remote server.

9. Rename

The Rename command renames a file on a remote computer using the FTP protocol.

Example:

This example will rename the file on the remote server:

Rename <OldFileName.txt> <NewFileName.txt>

According to the above code:

  • First, specify the Rename command.
  • Then, specify the existing file along with the file extension.
  • After that specify the new file name.

10. Open

The Open command lets you connect to the provided FTP server. It opens the specified FTP address on the remote server.

Example:

This example will open the specified server address on the remote computer:

Open <ftp.server.com>

To open the server on the remote computer, simply specify the server address to the Open command.

11. Close

The Close command closes the FTP session on the remote server. However, the prompt remains at the ftp> prompt.

Example:

This example closes the current FTP session on the remote computer:

Close

12. Mkdir

The Mkdir command creates a folder on the remote computer using the FTP protocol.

Example:

This example will create a new directory on the remote computer:

Mkdir <Directory-to-be-Created>

To create a directory on the remote computer, specify the directory to the Mkdir command.

Conclusion

PowerShell enables its users to interact with the FTP server. Users with TCP/IP protocol installed on their computers can have access to the FTP commands. PowerShell has a dedicated set of commands to manage the FTP protocol operations on a server. The most commonly used FTP commands include Ftp, Append, Delete, Send, Get, Rename, and Mkdir.

Share Button

Source: linuxhint.com

Leave a Reply