issue about `less` in ubuntu

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

issue about `less` in ubuntu

ping
less is so handy/quick...a swiss knife of file viewing.

amount the so many features, there are 2 of them I use the most:

search across multiple file : esc-/
show only the matched lines: &

but a lot of time I want to do both at the same time: search across multiples files and show me only the matched lines...

is that really not supported?

thanks!

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: issue about `less` in ubuntu

Jeff Lane-2
On Tue, Dec 17, 2013 at 1:09 PM, ping song <[hidden email]> wrote:

> less is so handy/quick...a swiss knife of file viewing.
>
> amount the so many features, there are 2 of them I use the most:
>
> search across multiple file : esc-/
> show only the matched lines: &
>
> but a lot of time I want to do both at the same time: search across
> multiples files and show me only the matched lines...
>
> is that really not supported?

Why can you not do this with grep and less?

grep "some string" file1 file2 file3 ... | less

for example:

grep "plugin" * | less

(FYI, this was run against the contents of /usr/share/checkbox/jobs/)

audio.txt.in:plugin: user-interact-verify
audio.txt.in: package.name == 'gir1.2-gst-plugins-base-0.10' or
package.name == 'gir1.2-gst-plugins-base-1.0'
benchmarks.txt.in:plugin: local
benchmarks.txt.in: plugin: shell
cpu.txt.in:plugin: shell
cpu.txt.in:plugin: shell
cpu.txt.in:plugin: shell
daemons.txt.in:plugin: shell
daemons.txt.in:plugin: shell
daemons.txt.in:plugin: shell

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: issue about `less` in ubuntu

ping
thanks.
but that's now what I liked...
I'd like always do search when files were loaded in an editor (vim) or pager (less), instead of blindly thinking what keyword to search ...

so definitely vim is the way to go.


On Tue, Dec 17, 2013 at 3:02 PM, J <[hidden email]> wrote:
On Tue, Dec 17, 2013 at 1:09 PM, ping song <[hidden email]> wrote:
> less is so handy/quick...a swiss knife of file viewing.
>
> amount the so many features, there are 2 of them I use the most:
>
> search across multiple file : esc-/
> show only the matched lines: &
>
> but a lot of time I want to do both at the same time: search across
> multiples files and show me only the matched lines...
>
> is that really not supported?

Why can you not do this with grep and less?

grep "some string" file1 file2 file3 ... | less

for example:

grep "plugin" * | less

(FYI, this was run against the contents of /usr/share/checkbox/jobs/)

audio.txt.in:plugin: user-interact-verify
audio.txt.in: package.name == 'gir1.2-gst-plugins-base-0.10' or
package.name == 'gir1.2-gst-plugins-base-1.0'
benchmarks.txt.in:plugin: local
benchmarks.txt.in: plugin: shell
cpu.txt.in:plugin: shell
cpu.txt.in:plugin: shell
cpu.txt.in:plugin: shell
daemons.txt.in:plugin: shell
daemons.txt.in:plugin: shell
daemons.txt.in:plugin: shell

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users