1

I'm trying to save the piped input to less to a file as explained in the man doc:

s filename
      Save the input to a file.  This only works if the input is a pipe, not an ordinary file.

However, when I hit s, instead of a prompt opening, the line just scrolls down as if I had hit j.

I'm using the version of less that comes with macOS:

$ less --version
less 581.2 (POSIX regular expressions)
Copyright (C) 1984-2021  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Home page: https://greenwoodsoftware.com/less

1 Answer 1

2

This feature seems to have been introduced in a more recent version than the one installed out of the box, at the moment.

Installing a current release using

brew install less

and restarting my shell fixed it.

Now I'm on version 608 as opposed to 581.2

$ less --version
less 608 (PCRE2 regular expressions)
Copyright (C) 1984-2022  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Home page: https://greenwoodsoftware.com/less

Now, when I hit s I get a prompt of log file: to type the file I want to save to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .