10 sFTP Command Examples to Transfer Files on Remote Servers in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Narad Shrestha

He has over 10 years of rich IT experience which includes various Linux Distros, FOSS and Networking. Narad always believes sharing IT knowledge with others and adopts new technology with ease.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Linux BASH Programming Cookbook
Getting Started with Ubuntu 16.04
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

33 Responses

  1. deb says:

    I tried to push all folders as well into another server, I did sftp> put *, it transfers all files excluding folder, then i created a folder and tried to sent the files like sftp> put wp-admin/* wp-admin (still it is sending all files of wp-admin to wp-admin excluding all folders). I have tried sftp> put -r foldername and tried get -r as well but i get “invalid flag -r”. I am using terminal, what shall i do ?

  2. Balu says:

    Hi Ravi,
    I am trying to use mput command to sftp multiple files with regular expression with below command:

    mput file*

    But this is not working and i have also tried the mput you have given in this article and i am getting an error saying
    “*” not found

    I’m using ksh to run sftp! Please help

    • Ravi Saive says:


      You should execute these commands in bash shell only, ksh shell have different switches I think, you need check man pages for this..

  3. Srinivas says:

    Can anyone brief me how MFT is different from SFTP.

    kindly share your valuable inputs on this as we want to migrate the file processing system from SFTP to MFT. Also suggest a few commands in MFT to transfer the files from different servers.

  4. Patrick Reynolds says:

    Very nice article. I was researching how to solve a problem with sftp and this article helped me greatly. Thanks.

    Regarding item #10, ‘Exist sFTP Shell’ probably should be ‘Exit sFTP Shell’.

    • Ravi Saive says:


      Thanks for finding this article helpful, and also thanks for notifying us about that typo, corrected in the writeup..

  5. Jaquice Stone says:

    Good morning guys. I’m having an issue with sftp. For some reason, unknown at the moment, sftp just stopped being able to send multiple files at once. I have a bunch of txt files in my folder and I’m running AIX, I can manually put only one at a time, wild cards like *.*, filename.* or even *.txt are no longer accepted. I have to put the full file for sftp to send it. This has been working for 3 months now but just stopped 2 days ago. Does anyone have a clue as to what happened?

  6. Sagar says:

    Very short and helpful article, Thanks

  7. Mikael says:

    I can not seem to input non english characters, such as Å, Ä or Ö (swedish a and o characters), in the linux CLI sftp client. When I try to nothing is printed.

    ls cmd displays files and dirs with these characters just fine, but I can not type in the characters, so entering a dir (cd) or downloading (get) a dir/file with any non english character seems impossible.

    This issue does not exist during a standard ssh shell login, so the locale does not seem to be the problem. It seems to be within the sftp client itself.

    Anyone who has an idea?

  8. SSS says:

    Can you please let me know how can I move files from one directory to another directory on SFTP server (mv equivalent)?

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?