find

Search files, directories and text by name, content, type, extension, depth and case.

FilesVersion 1.2.2Stable
lil-terminal

Overview

find combines simple filters instead of multiplying commands: type, extension, depth, case, content search and starting path can be composed to answer a precise filesystem question.

Narrow a search step by step

Build searches from broad to narrow: choose name or text search, then add path, type, extension, depth and case filters.

Syntax

lil-terminal
find [query] [-f|-F|-d] [-h|-t] [-e <ext>] [-c] [-p <path>]

Reference

find <query>

search names recursively in the current directory

find -q <query>

search for a query beginning with -

-f

search files only

-F | -d

search directories only

-h

search the current directory only

-t

search inside text files

-e <ext>

limit files by extension; tar.gz is supported

-php

short form for -e php

-c

use case-sensitive matching

-p <path>

start in another directory

find -e txt

show all files having this extension (query optional)

find -txt

show all files having this extension (query optional)

Working with results

find -e txt (or find -txt) lists all TXT files without a search phrase. find sample -e txt finds TXT filenames containing “sample”. Content search with -t still requires text.

Safety and limits

Use -p to start elsewhere and -h to search only that directory. -f cannot be combined with -F/-d. Result and scan limits protect shared hosting; symbolic links to directories are not traversed.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Search names recursively in the current directory

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install find
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install find -m
Exact public version

Install exactly this published version.

install find -v 1.2.2
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade find
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install find -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Search names recursively in the current directory
find app -p \sandbox\config
sandbox/config/app.conf
sandbox/config/app.ini
sandbox/config/app.ini.enc
sandbox/config/app.json
sandbox/config/app.properties
sandbox/config/app.toml
sandbox/config/app.xml
sandbox/config/app.yml
Search for a query beginning with -
find -q "-draft" -p \sandbox\tmp
No matches
Search files only
find app -f -p \sandbox\config
sandbox/config/app.conf
sandbox/config/app.ini
sandbox/config/app.ini.enc
sandbox/config/app.json
sandbox/config/app.properties
sandbox/config/app.toml
sandbox/config/app.xml
sandbox/config/app.yml
Search directories only
find data -F -p \sandbox
sandbox/data/
Search directories only
find data -d -p \sandbox
sandbox/data/
Search the current directory only
find app -h -p \sandbox\config
sandbox/config/app.conf
sandbox/config/app.ini
sandbox/config/app.ini.enc
sandbox/config/app.json
sandbox/config/app.properties
sandbox/config/app.toml
sandbox/config/app.xml
sandbox/config/app.yml
Search inside text files
find "timeout" -t -p \sandbox\logs
sandbox/logs/errors.log
Limit files by extension; tar.gz is supported
find -e txt -p \sandbox\data
sandbox/data/sample.txt
Short form for -e php
find Calculator -php -p \sandbox\src
sandbox/src/Calculator.php
Use case-sensitive matching
find SAMPLE -c -p \sandbox\data
No matches
Start in another directory
find app -p \sandbox\config -f
sandbox/config/app.conf
sandbox/config/app.ini
sandbox/config/app.ini.enc
sandbox/config/app.json
sandbox/config/app.properties
sandbox/config/app.toml
sandbox/config/app.xml
sandbox/config/app.yml
Show all files having this extension (query optional)
find -e txt -p \sandbox\tmp
sandbox/tmp/README.txt
sandbox/tmp/current.txt
sandbox/tmp/draft.txt
sandbox/tmp/new.txt
Show all files having this extension (query optional)
find -txt -p \sandbox\data
sandbox/data/sample.txt
Find · sample
find sample -e txt -p \sandbox\data
sandbox/data/sample.txt
Limit files by extension; tar.gz is supported
find -e tar.gz -p \sandbox\my
No matches
Search files only
find app -f -F -p \sandbox\config
Choose files or directories, not both
Start in another directory
find foo -p \sandbox\does-not-exist
Search directory not found

File used in this example: sandbox/src/Calculator.php

The example uses a file or directory from the protected /sandbox/ documentation workspace.

<?php

declare(strict_types=1);

final class Calculator
{
    public static function add(int $left, int $right): int
    {
        return $left + $right;
    }
}

Related documentation

Current public release

v1.2.22026-10-31

Extension-only search

find -e txt and find -txt list matching extensions without requiring a separate name query.