scp and sftp: A Quick Introduction

最低限の使い方まとめ。

scp

リモートホストへファイル転送

% scp test.txt username@remotehost:directory_name

ローカルホストへファイル転送

% scp username@remotehost:directory_name/test.txt .

ディレクトリの転送

% scp -r username@romotehost:directory_name .

sftp

ログイン

% sftp username@remotehost

リモートホストの操作

sftp> ls
sftp> cd remote_directory

ローカルホストの操作

sftp> lls
sftp> lcd local_directory

ファイルをダウンロードする

sftp> get test.txt
sftp> mget *.txt

ファイルをアップロードする

sftp> put mytest.txt
sftp> mput *.txt

終了

sftp> quit