CLI tool
jhspetersson/fselect avatar
jhspetersson/fselect

fselect: SQL-like file search from the command line

Find files with SQL-like queries

4,478 stars87 forksRustApache-2.0

At a glance

What is it?
fselect lets you query the filesystem with a relaxed SQL grammar, including subqueries, aggregate functions, archive search and index-backed lookups. It is a Rust CLI for people who already think in SELECT statements.
Who is it for?
Adopt fselect if you routinely write find expressions with several predicates, or if you want aggregates, image dimensions, EXIF or audio metadata in the same query. Skip it if you need a stable query language for scripts that must run unchanged for years, or if you only ever run single-predicate searches.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • jhspetersson/fselect4,478 ★ · +12
Star history
Repository2026-09-232026-11-22
jhspetersson/fselect4.5k4.5k

12 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The problem fselect solves for shell users

The README is explicit that fselect does not aim to replace find and ls. What it targets is the middle ground: searches where you want several conditions at once, or a computed column, and where a find command line turns into a stack of -name, -size, -mtime and -exec flags. fselect instead takes a statement shaped like a select, with columns, a from clause naming one or more roots, an optional where, group by, having, order by, limit and offset, and an into clause that picks the output format. The audience is anyone comfortable reading a query: developers cleaning up build output, admins hunting large files, people who want the dimensions of every image under a directory without writing a script. The grammar is described in the README as SQL-like but not real SQL, and deliberately relaxed, so it is meant to be typed by a human rather than generated by an ORM.

How the query engine and its clauses fit together

The invocation form is fselect followed by arguments: a column list, then from with one or more roots, then where, group by, having, order by, limit, offset and into FORMAT. The whole statement can also be passed as a single quoted argument, which is how the README shows the more complex examples. Roots are directories, and a depth modifier appears in one of the README examples, where a subquery selects from a path with depth 2. Subqueries are supported in the where clause through in and exists, and a subquery may also stand in the from clause as the source of the outer query, which the README illustrates with a select over a derived table aliased as src. Columns include name, path, abspath, size, fsize, hsize and modified; functions include MIN, MAX, AVG, SUM and COUNT, formatting functions such as LOWER, UPPER, LENGTH and YEAR, and the README notes that curly braces may be used in place of parentheses for aggregates. Filters reach beyond names and sizes: regular expressions of Rust flavor work with =~ and !=~, globs expand automatically with = and !=, and the feature list mentions MIME type, hashes, extended attributes, POSIX ACLs, Linux capabilities, image width and height, EXIF metadata and audio metadata across MP3, FLAC, Ogg Vorbis, Opus, M4A/AAC, WAV, AIFF, APE, WavPack, Musepack and Speex. Archives can be searched, and .gitignore, .hgignore and .dockerignore handling is offered as an experimental feature. For speed, fselect can consult the Everything index on Windows or plocate on Linux when built with the corresponding feature and passed the matching flag.

Installing fselect and running a first query

The README lists packaged builds for Debian and Ubuntu, Fedora, RHEL and openSUSE, Arch through the AUR, NixOS through nixpkgs, Windows binaries plus winget, Chocolatey and Scoop, and macOS binaries plus Homebrew and MacPorts. Building from source needs Rust with Cargo, and the README gives a single command for that path. After the install finishes, cargo places the binary in your Cargo bin directory, so fselect should be on your PATH.

bash
cargo install fselect

If you want index-backed search, the README says to build with a feature flag and pass the matching runtime flag. On Windows that is the Everything index; on Linux it is plocate. The README points at the usage guide under docs/usage.md for the details of both.

bash
cargo install fselect --features plocate
fselect --plocate name from /home/user

The first real query is the one the README opens its examples with: list the size and full path of configuration and temporary files under a home directory. Note that the pattern uses a single equals sign, not like, and that the two conditions are joined with or.

bash
fselect size, path from /home/user where name = '*.cfg' or name = '*.tmp'

On Windows the README says the quotes around patterns can be omitted. When a path contains spaces, the README offers three ways to write it: wrap the whole statement in double quotes, wrap the path in single quotes or backticks, or escape the single quotes with backslashes. A second useful shape is the aggregate query, which returns one row per aggregate rather than one row per file.

bash
fselect "MIN(size), MAX{size}, AVG(size), SUM{size}, COUNT(*) from /home/user/Downloads"

For an interactive session, the README documents a single flag, fselect -i, which starts the interactive mode backed by rustyline in the default feature set.

Where fselect is the wrong tool

The README itself sets the first boundary: fselect does not tend to fully replace find and ls. If your search is one predicate deep, find is shorter to type and universally present, and fselect adds an installation step to every machine that runs the script. The second boundary is the query language. It is relaxed and non-standard, which makes it pleasant to type and risky to treat as a frozen interface; a script written against fselect is a script written against this project's grammar, and the README does not promise SQL compatibility. Third, the ignore-file support is labelled experimental in the README, so do not assume .gitignore semantics match Git's own in every case. Fourth, the fast paths are conditional: Everything is a Windows-only index, plocate is Linux-only, and both require a build with the feature enabled and a runtime flag, so a stock binary will not be fast in the way the feature list implies. Finally, the metadata filters are only as good as the underlying parsers. Searching by EXIF or audio tags means fselect has to open and decode the file, which is a different cost profile from a name match.

How fselect differs from find and from indexed search tools

The closest alternative is find, which walks the tree itself and composes predicates with boolean operators on the command line. The difference is the shape of the expression: find reads left to right as a filter chain, while fselect reads as a projection with a where clause, so the columns you want are stated up front and the output format is chosen with into rather than by piping to awk or cut. That matters most when you want aggregates, since find has no equivalent of MIN, MAX, AVG, SUM or COUNT over a result set. The second kind of alternative is an index-backed search tool, and the README names two that fselect can borrow from rather than compete with: voidtools Everything on Windows and plocate on Linux. Those tools build and maintain an index and answer from it; fselect walks the filesystem by default and only consults an index when built and invoked for it. So the trade is inverted: an index tool is fast but sees only what the indexer recorded, while fselect sees the live tree and can inspect file contents, at the cost of touching the disk.

Maintenance, licence and what an upgrade costs

The repository is not archived, and the last push was on 2026-10-28, a few days after release 0.10.4 was published on 2026-10-23. The two releases before it, 0.10.3 and 0.10.2, landed on 2026-09-05 and 2026-06-28. Cargo.toml declares edition 2024 and a default feature set of git, users, interactive and mkv, with update-notifications, everything and plocate as opt-in. The git feature pulls in git2, users pulls in uzers on Unix, interactive pulls in rustyline and directories, mkv pulls in matroska, and update-notifications pulls in update-informer. That default set is worth reading before you build: a stock cargo install will include the interactive mode, and if you want a leaner binary you have to turn features off explicitly. Upgrading is a cargo install away, but the relaxed grammar means a minor release could change how a query parses. On licensing, Cargo.toml declares MIT OR Apache-2.0, and the repository carries LICENSE-APACHE and LICENSE-MIT. The practical effect of a dual licence is that a downstream user picks one of the two sets of terms; if you redistribute fselect inside a product, read both files and confirm which one you are relying on rather than assuming the choice is free of obligations.

Editorial conclusion

Adopt fselect if you routinely write find expressions with several predicates, or if you want aggregates, image dimensions, EXIF or audio metadata in the same query. Skip it if you need a stable query language for scripts that must run unchanged for years, or if you only ever run single-predicate searches. Before committing, check on your own machine that archive search, .gitignore handling and the Everything or plocate features behave as you expect, since the README labels the ignore support experimental. The query grammar is relaxed rather than standard SQL, so treat the usage guide as the specification and pin the version you install.

Frequently asked questions

How do I install fselect?

The README gives cargo install fselect for a source build, and lists packaged options including a deb package for Debian and Ubuntu, an rpm for Fedora, RHEL and openSUSE, the AUR on Arch, nixpkgs on NixOS, winget, Chocolatey and Scoop on Windows, and Homebrew or MacPorts on macOS.

What does an fselect query look like?

A statement starts with a column list, then from with one or more root directories, then optional where, group by, having, order by, limit, offset and into clauses. The README's first example is fselect size, path from /home/user where name = '*.cfg' or name = '*.tmp'.

Can fselect search inside archives or read image and audio metadata?

Yes. The README lists search within archives, image width and height, EXIF metadata, and audio metadata for formats including MP3, FLAC, Ogg Vorbis, Opus, M4A/AAC, WAV, AIFF, APE, WavPack, Musepack and Speex.

Does fselect support .gitignore files?

The README lists .gitignore, .hgignore and .dockerignore support but labels it experimental, so treat the behaviour as something to verify on your own tree rather than as guaranteed Git-compatible semantics.

What is fselect's licence?

Cargo.toml declares the package under MIT OR Apache-2.0, and the repository contains LICENSE-APACHE and LICENSE-MIT at the top level.

Official sources

  1. jhspetersson/fselect on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/jhspetersson-fselect.svg)](https://hysenlabs.com/projects/jhspetersson-fselect)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/jhspetersson-fselect.svg)](https://hysenlabs.com/projects/jhspetersson-fselect)

Was this useful?