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. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  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.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

37 Responses

  1. Varauc says:

    I have two questions.

    1. How can i rename more than one files?
    2. How can i cd with a direct path?

    For example, change from “/export/test” to “/import/test”.

  2. Mohan says:

    what sftp command do i need to use to download only one file from Multiple files from sftp server?

    For ex: test_1.txt ,
    test_4.txt resides on sftp server. All I would need is download only one file (Any one file)?

    • Ravi Saive says:


      Connect to sftp server, and use get command with filename to download the file, for example.

      sftp> get filename.txt
  3. 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 ?

  4. 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..

  5. 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.

  6. 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..

  7. 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?

  8. Sagar says:

    Very short and helpful article, Thanks

  9. 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?

  10. 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 *