Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    sftp problem: ls cannot be piped

    If I use sftp and list a remote directory, I cannot pipe it to "less" or "more":
    $ ls |less
    results in an error.
    But if I just use ls an tge directory contains a lot of files, i see just the last 20 or so.
    What can I do to avoid that?

    Best regards,


  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    First of all: What is the error?

    To take a guess, you are using sftp when you should be using ssh. sftp is supposed to be a secure replacement for ftp so it only accepts similar commands. When you try to pipe to less or more, you are telling it to list the pipe directory and the less directory (well, they could be files too, but you get my point).

    If you can't use ssh, can you just let the text run off the top of the screen and then scroll up (shift+page up at the console)?

    Hope that helps
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts