How to use linux shell to download and upload files via FTP SFTP or SCP ?
Question
SCP - Secure copy
Download a file via SCP
File : /tmp/mysql.dump.sql
Server/Login : THE_USERNAME:PASSWORD@domain.com
Download to : . (Current directory)
scp user:pass@domain.com:/tmp/mysql.dump.sql .
FTP - File Transfer Protocol
Connet to the server
ftp ftp.domain.com
Show the files in the current directory
ls
Show the current directory path
pwd
Change the directory
cd DIRECTODY_PATH
Change the directory in the local machine
lcd DIRECTODY_PATH
Download a file
get FILE_NAME
Download multimple files (Exampel all .txt files)
mget *.txt
Upload a file
put FILE_NAME
Upload multimple files (Exampel all .txt files)
mput *.txt
Delete a file
delete FILE_NAME
Delete a directory
rmdir
Close the connection from FTP server
quit
(or bye
)
Comments