Working with SFTP directories

About SFTP directory operations

After you establish a connection to an SFTP server, you can operate directories of the SFTP server.

Changing the working directory on the SFTP server

  1. Enter SFTP client view.

    For more information, see "Establishing a connection to an SFTP server."

  2. Change the working directory on the SFTP server.

    cd [ remote-path ]

  3. (Optional.) Return to the upper-level directory.

    cdup

Displaying the current working directory on the SFTP server

  1. Enter SFTP client view.

    For more information, see "Establishing a connection to an SFTP server."

  2. Display the current working directory on the SFTP server.

    pwd

Displaying files under a directory

  1. Enter SFTP client view.

    For more information, see "Establishing a connection to an SFTP server."

  2. Display files under a directory.

    • dir [ -a | -l ] [ remote-path ]

    • ls [ -a | -l ] [ remote-path ]

    The dir command has the same function as the ls command.

Changing the name of a directory on the SFTP server

  1. Enter SFTP client view.

    For more information, see "Establishing a connection to an SFTP server."

  2. Change the name of a directory on the SFTP server.

    rename oldname newname

Creating a new directory on the SFTP server

  1. Enter SFTP client view.

    For more information, see "Establishing a connection to an SFTP server."

  2. Create a new directory on the SFTP server.

    mkdir remote-path

Deleting directories on the SFTP server

  1. Enter SFTP client view.

    For more information, see "Establishing a connection to an SFTP server."

  2. Delete one or more directories from the SFTP server.

    rmdir remote-path