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] DESTINATIONParameters & Attributes
| Name | Type | Description |
|---|---|---|
| DESTINATION | operand | Authorized user and host |
| -P | option | Port |
| -b | option | Batch 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