Re: How to save filtered less results in a file or on stdout

2021-04-11 Thread l0f4r0
Hi, Thank you everyone for your last replies. Everything you suggested works as expected. Bottom line: * less: no quick/immediate way (i.e. like a shortcut) to save only the filter output. One needs to pipe through `grep` with the same filter(s) in `less` shell * vim (but it certainly works

Re: How to save filtered less results in a file or on stdout

2021-04-07 Thread David Wright
On Wed 07 Apr 2021 at 08:30:30 (+), Curt wrote: > On 2021-04-07, David Wright wrote: > >> > > >> > But I don't know how vim would do on-the-fly filtering like > >> > less can do with & (not being very familiar with vim). > >> > >> :g/pattern/.w! >> output.txt > >> > >> I pressed 'v' in

Re: How to save filtered less results in a file or on stdout

2021-04-07 Thread Curt
On 2021-04-07, David Wright wrote: >> > >> > But I don't know how vim would do on-the-fly filtering like >> > less can do with & (not being very familiar with vim). >> >> :g/pattern/.w! >> output.txt >> >> I pressed 'v' in less, searched a pattern and wrote the filtered output >> to a file

Re: How to save filtered less results in a file or on stdout

2021-04-06 Thread David Wright
On Tue 06 Apr 2021 at 09:12:45 (+), Curt wrote: > On 2021-04-06, David Wright wrote: > > On Tue 06 Apr 2021 at 01:09:09 (+0100), jr wrote: > >> on Mon, 5 Apr 2021 17:44:28 Andrei POPESCU wrote: > >> > If you are willing to learn (neo)vim, '(n)vim -R' as 'view' can be used > >> > instead of

Re: How to save filtered less results in a file or on stdout

2021-04-06 Thread David Wright
On Tue 06 Apr 2021 at 08:34:24 (+0300), Andrei POPESCU wrote: > On Lu, 05 apr 21, 22:29:31, David Wright wrote: > > > > But I don't know how vim would do on-the-fly filtering like > > less can do with & (not being very familiar with vim). > > A quick web search suggests: > > :v/pattern/d >

Re: How to save filtered less results in a file or on stdout

2021-04-06 Thread Curt
On 2021-04-06, David Wright wrote: > On Tue 06 Apr 2021 at 01:09:09 (+0100), jr wrote: >> on Mon, 5 Apr 2021 17:44:28 Andrei POPESCU wrote: >> > If you are willing to learn (neo)vim, '(n)vim -R' as 'view' can be used >> > instead of 'less', with all the power of an advanced editor at your >> >

Re: How to save filtered less results in a file or on stdout

2021-04-05 Thread Andrei POPESCU
On Lu, 05 apr 21, 22:29:31, David Wright wrote: > > But I don't know how vim would do on-the-fly filtering like > less can do with & (not being very familiar with vim). A quick web search suggests: :v/pattern/d press 'u' to undo or ':w filename.txt' to write the result to a different

Re: How to save filtered less results in a file or on stdout

2021-04-05 Thread David Wright
On Tue 06 Apr 2021 at 01:09:09 (+0100), jr wrote: > on Mon, 5 Apr 2021 17:44:28 Andrei POPESCU wrote: > > If you are willing to learn (neo)vim, '(n)vim -R' as 'view' can be used > > instead of 'less', with all the power of an advanced editor at your > > disposal. … or '| vim -R -' or even '| vim

Re: How to save filtered less results in a file or on stdout

2021-04-05 Thread jr
on Mon, 5 Apr 2021 17:44:28 Andrei POPESCU wrote: > If you are willing to learn (neo)vim, '(n)vim -R' as 'view' can be used > instead of 'less', with all the power of an advanced editor at your > disposal. or just press 'v' in 'less'? -- regards, jr. You have the right to free speech, as long

Re: How to save filtered less results in a file or on stdout

2021-04-05 Thread Andrei POPESCU
On Lu, 29 mar 21, 01:20:18, l0f...@tuta.io wrote: > > Actually, I asked this question because of my workflow here. > > First, I use the less pager to navigate quickly inside an input, not knowing > beforehand what it looks like and what I will need to do. > Then, I filter some lines depending on

Re: How to save filtered less results in a file or on stdout

2021-04-04 Thread l0f4r0
Hi David, 29 mars 2021, 03:25 de deb...@lionunicorn.co.uk: > . type & again, > . UpArrow to recall this latest pattern that you're happy with, > . LeftDrag the mouse to copy the pattern, > . Backspace to rubout the line (the & remains there), > . type | and respond appropriately to the mark:

Re: How to save filtered less results in a file or on stdout

2021-03-28 Thread David Wright
On Mon 29 Mar 2021 at 00:45:28 (+0200), l0f...@tuta.io wrote: > 28 mars 2021, 21:27 de deb...@lionunicorn.co.uk: > > > When you've used > > & pattern > > to display lines containing your pattern, then > > | . grep pattern > filename > > will apply the same filter to the lines selected by | .,

Re: How to save filtered less results in a file or on stdout

2021-03-28 Thread l0f4r0
Songbird, 29 mars 2021, 00:55 de songb...@anthive.com: > if you are going to do something to the contents of > a file you can use: > > $ grep "pattern" filename > output > > there are different versions of grep command (egrep and > fgrep too besides just grep - check the man pages). > > if you

Re: How to save filtered less results in a file or on stdout

2021-03-28 Thread songbird
l0f...@tuta.io wrote: > Hi, > > Strictly speaking, my question is not on Debian itself, but on usage of less > command running on my Buster (487-0.1+b1). > > Is there a way to save *filtered* less results in a file or on stdout please? > > What I mean by "filtered" is results obtained via "&" or

Re: How to save filtered less results in a file or on stdout

2021-03-28 Thread l0f4r0
Hi David and thanks for your feedback. 28 mars 2021, 21:27 de deb...@lionunicorn.co.uk: > When you've used > & pattern > to display lines containing your pattern, then > | . grep pattern > filename > will apply the same filter to the lines selected by | ., where > I've used . but you could use

Re: How to save filtered less results in a file or on stdout

2021-03-28 Thread David Wright
On Sun 28 Mar 2021 at 20:38:08 (+0200), l0f...@tuta.io wrote: > > Strictly speaking, my question is not on Debian itself, but on usage of less > command running on my Buster (487-0.1+b1). > > Is there a way to save *filtered* less results in a file or on stdout please? > > What I mean by

How to save filtered less results in a file or on stdout

2021-03-28 Thread l0f4r0
Hi, Strictly speaking, my question is not on Debian itself, but on usage of less command running on my Buster (487-0.1+b1). Is there a way to save *filtered* less results in a file or on stdout please? What I mean by "filtered" is results obtained via "&" or "&!" command inside less. Indeed,