Saturday, December 8, 2007

Using lftp in copying files between two servers in ssh

LFTP is sophisticated ftp/http client, file transfer program supporting a number of network protocols. It is very useful and I've been always using this. There is this case where I need to login on one server through ssh before I will connect to this server and this has helped me a lot.

To connect to a server type :
lftp -u [username],[password] [servername]

Example : lftp -u username,password example.com

Once you are connected, you can do basic commands like "cd" to change directories and "ls" to list files and subdirectories.

To download a file, go to the directory where you want to download the file then connect to the other server using lftp. Go to the directory where the file you want to copy is located then type :
get [filename]

Example : get myfile.txt

To upload a file, go to the directory where the file is located then connect to the other server using lftp. Go to the directory where you want to upload the file then type :
put [filename]

Example : put myfile.txt

Easy isn't it? And it will help you a lot too. Try it out! :)

Tuesday, December 4, 2007

A few linux commands

It's a slow day today. So I'm going to share some very helpful linux commands. These commands are what I always use every time I work since I log in through the server using ssh. This is just an overview of the basic commands. I might discuss later the advance use of each command.

  1. ls - show files and subdirectories under the current directory.

  2. pwd - shows current directory you are

  3. cd - change directory.
    • to go to the parent directory type "cd .." without the quotes
    • to go into a subdirectory, type "cd yoursubdirectoryname" without the quotes

  4. cp - copies a file or a directory.
    • to copy a file, type "cp originaldirectory/originalfile destination/newfile" without the quotes
    • to copy a directory just add -r like "cp -r originaldirectory destination" without the quotes.

  5. rm - removes a file or directory
    • to remove a file, type "rm filename" without the quotes
    • to remove a directory, type "rm -rf direc" without the quotes

  6. vi - opens a powerful text editor. I use this every time.
This is it for now. I will add more later on about connecting to another server using ssh, etc. I hope these are helpful.