Skip to content
/ finder Public

a command to locate a file in a directory

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.mit
Unlicense
LICENSE.unlicense
Notifications You must be signed in to change notification settings

asynts/finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

finder

This is essentially locate from findutils but for local directories.

The program recursivly searches for files and builds a database which can be queried for filenames.

Usage

usage: finder [OPTIONS] [FILENAME]
OPTIONS
        --help          display usage information
        --version       display version information
    -r, --rebuild       rebuild cache
    -l, --list          list all filepaths from the cache

Examples

Finder can be used to locate all filepaths in a directory that have the same filename:

$ mkdir -p a/b/c
$ touch foo.txt a/bar.txt a/b/foo.txt a/b/c/bar.txt
$ finder --rebuild                                      # rebuild the cache
$ finder foo.txt                                        # search for 'foo.txt'
./foo.txt
./a/b/foo.txt
$ finder --list                                         # list all cached files
./foo.txt
./a/bar.txt
./a/b/foo.txt
./a/b/c/bar.txt
$ touch bar.txt
$ finder --list                                         # finder doesn't know about './bar.txt'
./foo.txt                                               # until the cache is rebuild
./a/bar.txt
./a/b/foo.txt
./a/b/c/bar.txt

The --list option can be used with grep or other utilities to search for more complex patterns:

$ mkdir -p a/b/c
$ touch foo.txt a/bar.txt a/b/foo.png
$ finder --rebuild --list | grep '.txt$'                 # find all the files that have the file
./foo.txt                                                # extension '.txt'
./a/bar.txt

About

a command to locate a file in a directory

Topics

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.mit
Unlicense
LICENSE.unlicense

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published