Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude directories in glimpse?

Tags:

glimpse

I'm using glimpse and I want to exclude searching through some files. I'm using a shared version of glimpse so I can't place a ".glimpse_exclude" file in that directory. I tried putting this file in my own local directory but that didn't work (maybe the answer to my question is more about where I can place this file so that glimpse will find it and use my local version?).

I see that there's a "glimpse -W "a;~b" which can exclude an expression (b, in this case), but I want to exclude a directory, something like:

glimpse -F "~exclude/this/directory/" mysearchwords

The best I have is to pipe this through grep and use grep's exclude functionality:

glimpse mysearchwords | grep -v "exclude/this/directory"

My main issue with this is that it loses glimpse's color coding so is a bit harder to look through the results.

In sum: what's the best way to exclude files for glimpse, without using the .glimpse_exclude file, and/or where can I place that file locally so it will be used when I run searches but will not affect the global glimpse command shared across my network?

like image 448
Blue Raspberry Avatar asked Nov 09 '22 08:11

Blue Raspberry


1 Answers

In glimpse 3.5, as per http://ftp.icm.edu.pl/packages/glimpse/CHANGES ,

3.0 --> 3.5 - added "-f filename" option to glimpse: it allows you to restrict the search to only those files whose names appear in "filename". - fixed the agrep bug where -n was not working with ISO characters.

like image 165
mikep Avatar answered Jan 04 '23 01:01

mikep