ZFIND(1)
π NAME π
okay so bestie, <rainbow>zfind</rainbow> β it searches for files, and yes it looks inside archives too. no cap. π₯
β¨ SYNOPSIS β¨
zfind [<where> [<path> ...]] [flags]
πΈ DESCRIPTION πΈ
zfind makes finding files easy, and the filter syntax is lowkey giving SQL-WHERE clause energy. it's giving "I took the WHERE from your database and put it in your shell". π
For examples run zfind -H or go to https://github.com/laktak/zfind.
π Arguments π
[<where>]β the filter, using SQL-where syntax (peep-Hfor the deets). If you wanna skip it but still give a path, just use-.[<path> ...]β the paths to search. yes plural, go off. π
π«Ά Flags π«Ά
-h,--helpβ show context-sensitive help.-H,--filter-helpβ show where-filter help. (this is the one you want when you're confused, bestie.)-l,--longβ show long listing format.--csvβ show listing as CSV.--csv-no-headβ show listing as CSV, but with no header. the header said "not today" π--archive-separator="//"β separator between the archive name and the file inside.-L,--follow-symlinksβ follow symbolic links.-n,--no-archiveβ disables archive support.-0,--print0β use a null character instead of the newline character. it's made to be used with the-0option ofxargs.-V,--versionβ show version.
π₯ EXAMPLES π₯
here are the vibes, verbatim, slay:
# find files smaller than 10KB, in the current path
zfind 'size<10k'
# find files in the given range in /some/path
zfind 'size between 1M and 1G' /some/path
# find files modified before 2010 inside a tar
zfind 'date<"2010" and archive="tar"'
# find files named foo* and modified today
zfind 'name like "foo%" and date=today'
# find files that contain two dashes using a regex
zfind 'name rlike "(.*-){2}"'
# find files that have the extension .jpg or .jpeg
zfind 'ext in ("jpg","jpeg")'
# find directories named foo and bar
zfind 'name in ("foo", "bar") and type="dir"'
# search for all README.md files and show in long listing format
zfind 'name="README.md"' -l
# show results in csv format
zfind --csv
zfind --csv-no-head
π¦ Where Syntax π¦
this is the part where it gets good. π
AND,ORand()parentheses are logical operators, and you use them to combine multiple conditions.ANDmeans both conditions gotta be true for a row to show up in the results.ORmeans if either condition is true, the row gets included. parentheses group conditions, just like in math class (but actually useful this time).
Example: '(size > 20M OR name = "temp") AND type="file"' selects all files that are either greater than 20 MB in size or are named temp.
- Operators
=,<>,!=,<,>,<=,>=are comparison operators, used to compare values and file properties. the types must match, meaning don't compare a date to a file size. that's not it, bestie. π
Example: 'date > "2020-10-01"' selects all files that were modified after the specified date.
LIKE,ILIKEandRLIKEare used for pattern matching in strings.LIKEis case-sensitive, whileILIKEis case-insensitive.- The
%symbol is the wildcard character that matches any sequence of characters. - The
_symbol matches any single character. RLIKEallows matching a regular expression.
Example: '"name like "z%"' selects all files whose name starts with `z'.
INlets you specify multiple values to match. a file gets included if the value of the property matches any of the values in the list. iconic behaviour honestly.
Example: '"type in ("file", "link")' selects all files of type file or link.
BETWEENselects values within a given range (inclusive, so the edges count too π ).
Example: '"date between "2010" and "2011-01-15"' means that all files that were modified from 2010 to 2011-01-15 will be included.
NOTis a logical operator used to negate a condition. it returns true if the condition is false, and vice versa. yes, the hater of operators. π«
Example: '"name not like "z%"', '"date not between "2010" and "2011-01-15"', '"type not in ("file", "link")'
- Values can be numbers, text, date and time,
TRUEandFALSE.- dates have to be specified in
YYYY-MM-DDformat - times have to be specified in 24h
HH:MM:SSformat - numbers can be written as sizes by appending
B,K,M,GandTto specify bytes, KB, MB, GB, and TB. - empty strings and
0evaluate to false
- dates have to be specified in
π Properties π
these are the file properties you get to play with:
nameβ name of the filepathβ full path of the filecontainerβ path of the container (if inside an archive)sizeβ file size (uncompressed)dateβ modified date inYYYY-MM-DDformattimeβ modified time inHH:MM:SSformatextβ short file extension (e.g.,txt)ext2β long file extension (two parts, e.g.,tar.gz)typeβfile,dir, orlinkarchiveβ archive type:tar,zip,7z,raror empty
β Helper properties β
todayβ today's datemoβ last monday's datetuβ last tuesday's dateweβ last wednesday's datethβ last thursday's datefrβ last friday's datesaβ last saturday's datesuβ last sunday's date
π Supported archives π
tarβ.tar,.tar.gz,.tgz,.tar.bz2,.tbz2,.tar.xz,.txzzipβ.zip7zipβ.7zrarβ.rar
Note: use the flag-n(orβno-archive) to disable archive support. you can also use'not archive'in your query, but heads up: that still requireszfindto open the archive. it's giving "I said I don't want to look but I looked" π
π Actions π
zfind does not implement actions like find does β instead, use xargs -0 to execute commands:
zfind --no-archive 'name like "%.txt"' -0 | xargs -0 -L1 echo
zfind can also produce --csv (or --csv-no-head) that can be piped to other commands. pipe it, queen. πΈ
π§ CONFIGURATION π§
Set the environment variable NO_COLOR to disable color output. (no colors, no drama. well. some drama.)
π SEE ALSO π
π AUTHORS π
zfind is developed by Christian Zangl, see https://github.com/laktak/zfind.
This man page has been written by Daniel Lange <DLange@debian.org> for Debian based on the project's README file.
and that's the whole thing bestie π«Ά this page is from zfind, 2025, and yeah that's the ZFIND(1) moment. go find some files, no cap. β¨π
π¦ where this page comes from
- ubuntu stonking: zfind 0.4.7-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms