File Transfer in GNU/Linux
FTP (file transfer protocol)
This is mostly used to copy files between computers. It doesn’t support compression. It is also not encrypted. This is how to transfer files.
To connect to aloke.info
ftp aloke.info
You will have to enter your username and password when prompted.
If the file being transferred is a binary file (yes, PDF and PS are binary files), type the following.
binary
To upload your file aloke.pdf to the directory in aloke.info
cd /home/aloke/backup
put aloke.pdf
To download the file aloke.txt from the directory in aloke.info
get aloke.txt
If you have multiple files, use mget instead of get and mput instead of put.
To quit, type bye. This is just the basic file transfer using FTP. To check all the options using FTP, type man ftp from your shell prompt.
SFTP (secure file transfer protocol)
SFTP is an interactive file transfer program, similar to FTP, which performs all operations over an encrypted secsh transport. If you are a Windows user, you will need a secure file transfer program like WinSCP program.
To connect to aloke.info here is what you should do.
sftp aloke.info
You will have to enter your username and password when prompted.
To upload your file aloke.pdf to the directory in aloke.info
cd /home/aloke/backup
put aloke.pdf
To download the file aloke.txt from the directory in aloke.info
get aloke.txt
If you want to download multiple files, say all PDF files,
get *.pdf
To quit, type exit. This is just the basic SFTP. To check all the options using SFTP, type man sftp from your shell prompt.
SCP (secure copy)
SCP is used for single file transfers unlike SFTP or FTP, where once connected, you can carry out any number of transfers.
To upload the file aloke.pdf to the /home/aloke/backup in the remote computer aloke.info here is what you should do. Lets say the username and password for connecting to aloke.info are aloke and p4ssword respectively, read ahead.
scp aloke.pdf aloke@aloke.info:/home/aloke/backup/
You will be prompted for your password, which you should enter. It uploads the file and quits automatically.. all in one operation.
To download the file aloke.txt from the remote directory, here is what you must do.
scp aloke@aloke.info:/home/aloke/backup/aloke.txt
If you want to upload the entire perl directory (recursively) here is what you do.
scp -r /home/aloke/perl us3r@aloke.info:/home/aloke/backup/
wget
To download the index.html page of gnome.org, here is what you type.
wget http://www.aloke.info/index.html
… and you have the index.html page on your current directory
If you want to rip the website upto 3 levels,
wget -r -l 3 http://www.aloke.info
This entry was posted on Saturday, August 2nd, 2008 at 10:46 pm and is filed under General. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


