Skip to main content

Search and count

search returns entries. count accepts the same filters but returns only the number of matches. All supplied filters are combined with AND.

fsindex search [QUERY] [OPTIONS]

The optional positional QUERY is matched against file names unless --search-path is set.

fsindex search img --file --ext jpg --limit 20
fsindex search --path /projects --regex 'report.*\.pdf$' --sort mtime --desc
fsindex search --min-size 100M --volume-name Ext
fsindex search vacation --modified-after 30d

count​

fsindex count [QUERY] [OPTIONS]

Use it for existence and aggregate checks:

fsindex count --ext rs
fsindex count Cargo --file --path /projects

Sorting, pagination, and reverse order do not change a count's meaning, though the CLI accepts the shared search argument set.

Matching options​

OptionMeaning
QUERYSubstring—or regex with --regex—matched against names.
--path <STRING>Match a substring or regex against the full path.
--regexInterpret QUERY and --path as regular expressions.
--case-sensitiveMatch case-sensitively; default matching is case-insensitive.
--search-pathMatch QUERY against the whole path rather than only the name.

Entry and volume filters​

OptionMeaning
--volume <ID>Restrict to a volume ID. Repeatable.
--volume-name <NAME>Restrict to a volume name or mount containing the value. Repeatable or comma-separated.
--fileReturn only files. Conflicts with --dir.
--dirReturn only directories.
--symlinkReturn only symbolic links.
--ext <EXT>Restrict by extension; the dot is optional. Repeatable or comma-separated.
--include-offlineInclude cached entries belonging to offline volumes.
Kind flags

If several non-conflicting kind flags are provided, the CLI resolves them in the order --file, --dir, then --symlink. Use one kind flag per query.

Size and time filters​

OptionMeaning
--min-size <SIZE>Minimum size.
--max-size <SIZE>Maximum size.
--modified-after <TIME>Modified at or after a Unix timestamp, or within a relative duration.
--modified-before <TIME>Modified at or before a Unix timestamp, or relative duration.

Sizes accept raw bytes or binary suffixes B, K, M, G, and T; decimal values are allowed. For example, 1.5G is converted to bytes using powers of 1024.

Times accept Unix seconds or a relative age. Relative units include seconds (s), minutes (m), hours (h), days (d), weeks (w), 30-day months (mo), and 365-day years (y), plus their documented long forms.

fsindex search --min-size 1.5G --max-size 4G
fsindex search --modified-after 12h
fsindex search --modified-before 2w

Sorting and pagination​

OptionDefaultMeaning
--sort <KEY>namename, path, size, mtime, kind, or extension.
--descoffReverse sort order.
--limit <N>50Maximum results; 0 asks the daemon to apply its default.
--offset <N>0Skip the first N matches.
--jsonoffEmit the full structured response.

The human-readable summary reports the displayed range, total matches, query duration, and a freshness note when the index is incomplete.