Saturday, March 7, 2015

Linux Copy Files Remotely Over SFTP

Using ssh between systems running Linux and always in need to transfer files back and force...?
Then you should consider using sftp as you will be able to copy files so easy unless you use a GUI application to click, click, click, which is OK and nothing wrong with that.  But, for me I like to feel the move and be in control...

So, sftp has the same commands almost as ssh that connects you to your remote PC.  However, it also has the commands that can run on your local PC.  So, after you login to your remote session, all sftp commands you type should run on your remote session,

If you type ls, then you are listing all commands in your remote session.
Now, type
lls
and you see list of all files in local folder you started from


If you type

  • mkdir xyz   you created folder in your remote PC

now type

  • lmkdir xyz  and you created folder in your remote PC



If you type:

  • pwd  you will list current working directory on remote PC

now type

  • lpwd  you will see your current working directory on local PC


Here are some useful commands that I need to use all the time


  • put puts files from your local working directory to the remote directory
  • get gets files from your remote directory to local directory





All following commands work on remote PC and when you add l, that is lower case L, you run them on local PC

  • lls, ls
  • lpwd, pwd
  • lmkdir, mkdir


No comments:

Post a Comment