rmdir - Remove directories on the remote server in SFTP

You can delete a directory/folder in remote server programmatically by the SFTP.

Syntax:
psftp> rmdir 'Directory name'


Note:
The folder name must exist in the path.
Other wise PSFTP will throw "File not found" error.

Example:
psftp> pwd
current remote working directory is /home/user1
psftp> rmdir ForgetCode
psftp>


ForgetCode folder will be deleted in /home/user1 path after executing the above code.