SCP and SFTP Cheat Sheet/Run SFTP in batch mode

Execute SFTP commands from a batch file.

Section: sftp Basics

Run SFTP in batch mode

bash
bash
sftp -b batch.txt user@example.com
Explanation

Execute SFTP commands from a batch file.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing sftp Basics
Open an SFTP session
Start an interactive SFTP shell.
OpenIn sheetbashsame section
Connect to SFTP on a custom port
Specify a non-default SSH port for SFTP.
OpenIn sheetbashsame section
Resume an interrupted download
Continue downloading a partially transferred file.
OpenIn sheettextsame section
Resume an interrupted upload
Continue uploading a partially transferred file.
OpenIn sheettextsame section
Upload within interactive sftp
Put a file during an interactive session.
OpenIn sheettextsame section
Download within interactive sftp
Get a file during an interactive session.
OpenIn sheettextsame section