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 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
)
Comments