Skip to content
/ rfind Public

A command-line tool that searches for files in reverse order (i.e. to ancestor direction)

License

Notifications You must be signed in to change notification settings

moznion/rfind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rfind

A command-line tool that searches for files in reverse order (i.e. to ancestor direction).

The result of the found files' paths ensures that they are ordered by the length of the match, with longer matches appearing first.

Usage

Usage:
  rfind [OPTIONS] ORIGIN_PATH TARGETS...
Options:
  -dir-only
        Find only directory
  -file-only
        Find only file
  -limit uint
        Limit the number of found items (default: unlimited)
  -max-depth-from-root uint
        Max number of path depth to search from root (default: unlimited)
  -max-upper-depth uint
        Max number of path depth to search from the ORIGIN_PATH to ancestor direction (default: unlimited)

Examples

When the directory structure is as follows:

/
├── bar
├── buz
│    ├── qux
│    │    └── target.txt
│    └── target.txt
├── foo
│    └── target.txt
└── target.txt

And the current directory is /buz/qux, the following command will find target.txt in the ancestor directories:

$ rfind . target.txt # `rfind /buz/qux target.txt` also works as well
/buz/qux/target.txt
/buz/target.txt
/target.txt

And the targets can be accepted the multi leaved paths:

$ rfind /buz/qux foo/target.txt
/foo/target.txt

Author

moznion ([email protected])

License

MIT

About

A command-line tool that searches for files in reverse order (i.e. to ancestor direction)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages