# Handy scripts for fuzzy searching nixpkgs and nixos-options

**URL:** https://discourse.nixos.org/t/handy-scripts-for-fuzzy-searching-nixpkgs-and-nixos-options/1659
**Category:** Guides
**Created:** [December 11, 2018, 6:33pm UTC](https://discourse.nixos.org/t/handy-scripts-for-fuzzy-searching-nixpkgs-and-nixos-options/1659 "2018-12-11T18:33:17Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![manveru](https://discourse.nixos.org/user_avatar/discourse.nixos.org/manveru/32/23_2.png) [@manveru](https://discourse.nixos.org/u/manveru)
#### Post date: [March 31, 2019, 7:57am UTC](https://discourse.nixos.org/t/handy-scripts-for-fuzzy-searching-nixpkgs-and-nixos-options/1659/10 "2019-03-31T07:57:04Z")

</div>

Might as well post my little script here for searching files in a directory that contains _all_ the given words, no matter what line they’re on. So it’s awesome for writing your own package and searching examples in nixpkgs like “where did someone use `makeWrapperArgs` and `PATH`”.

```ruby
#!/usr/bin/env ruby

Dir.glob('**/*') do |path|
  next unless File.file?(path)
  File.open(path, 'r:binary'){|io|
    ARGV.all?{|word|
      io.rewind
      io.grep(/#{word}/).any?
    } && puts(path)
  }
end

```

Usage like `find-all-with-words setupPyBuildFlags buildPython`.

---

_[View the full topic](https://discourse.nixos.org/t/handy-scripts-for-fuzzy-searching-nixpkgs-and-nixos-options/1659)._
