How to use linux shell to download and upload files via FTP SFTP or SCP ?
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 directoryls
Show the current directory pathpwd
Change the directorycd DIRECTODY_PATH
Change the directory in the local machinelcd DIRECTODY_PATH
Download a fileget FILE_NAME
Download multimple files (Exampel all .txt files)mget *.txt
Upload a fileput FILE_NAME
Upload multimple files (Exampel all .txt files)mput *.txt
Delete a filedelete FILE_NAME
Delete a directoryrmdir
Close the connection from FTP serverquit
(or bye
)
Add new comment