commands

sftp — Interactive SSH file transfer

Use SSH-based file transfer; interactive commands include ls, pwd, lpwd, get, put and bye. Remote and local working directories are separate. Batch operation failures can affect exit status. Use a fresh private workspace; live operations are VM-only.

Formal Syntax & Structure

linux syntaxlinux
sftp [OPTIONS] DESTINATION

Parameters & Attributes

NameTypeDescription
DESTINATIONoperandAuthorized user and host
-PoptionPort
-boptionBatch command file

Return Value

exit status and output

Use SSH-based file transfer; interactive commands include ls, pwd, lpwd, get, put and bye. Remote and local working directories are separate. Batch operation failures can affect exit status.

Working Example

Example Snippetlinux
sftp -o StrictHostKeyChecking=yes -o UserKnownHostsFile=./known_hosts learner@lab-server.example
Linux Reference