Reputation: 901
Say I have to upload file dir-a/dir-b/dir-c/xxx.txt
using sftp
dir-a/dir-b/dir-c
- is it one command or three?Upvotes: 0
Views: 1270
Reputation: 25946
Should I create the target directory first?
Usually yes. SFTP servers usually do not create parent directory. But how hard is it to try first?
Should I open target directory before copying the file?
You do not have to. put
command does accept a remote-path
, which can be either absolute or relative to remote working directory.
If have to create this path dir-a/dir-b/dir-c - is it one command or three?
These are three commands:
mkdir dir-a/
mkdir dir-a/dir-b/
mkdir dir-a/dir-b/dir-c
Upvotes: 1