I was looking for something similar to WinScp for MacBook Pro, but could not find it. There are similar tools available to do the same task but I did'nt want to install an unknown application.
Finally I had to resort to SFTP.
In the following example I am trying to connect to a remote Linux server from my local MacBook-Pro and upload some *.csv files from my local folder to a remote folder.
Steps:
//// Provide user and password for authentication
sftp> cd /var/lib/users/test/destination-dir
// Upload all *.csv files using mput command
sftp> mput *.csv
Or
// Upload a specific file using put command
sftp> put testout.csv
>gzip testout.csv
//It will create testout.csv.gz
// Upload on server using SFTP as mentioned above
//Unzip the file on remote server
>gzip -d testout.csv.gz
Finally I had to resort to SFTP.
In the following example I am trying to connect to a remote Linux server from my local MacBook-Pro and upload some *.csv files from my local folder to a remote folder.
Steps:
- Connect to remote server
Connecting to remote.secure-wb1-hvbd.com... remote.secure-wb1-hvbd.com FTP server ready. Name: yourusername Password:
//// Provide user and password for authentication
- Navigate to Remote Destination Directory
sftp> cd /var/lib/users/test/destination-dir
- Use the lcd command to specify the local source directory where file to be uploaded, exists.
- Use the put (single file), mput (multiple files) commands to upload the files to remote directory.
// Upload all *.csv files using mput command
sftp> mput *.csv
Or
// Upload a specific file using put command
sftp> put testout.csv
- Similarly get and mget can be used to retrieve the files.
- For larger files, we might encounter the following error [rite failed: Broken pipe]. Use the zip utility to zip the file first and then do sftp. For Example:
>gzip testout.csv
//It will create testout.csv.gz
// Upload on server using SFTP as mentioned above
//Unzip the file on remote server
>gzip -d testout.csv.gz
No comments:
Post a Comment