about summary refs log tree commit diff stats
path: root/README.md
blob: 69f763a2dde9deca3a039687081267e7aa346619 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# rf

> A tiny and simple cross-platform file finder

## Installation

### Platform Support

Ideally all the following platforms will eventually be supported:

- [X] Linux glibc
- [X] Linux musl
- [X] macOS
- [ ] Win32
- [X] FreeBSD
- [X] OpenBSD
- [ ] NetBSD
- [ ] DragonFlyBSD
- [ ] illumos
- [ ] Haiku

### From Source

__Requirements:__

Minimum requirements are a C99 compiler and a POSIX-like environment. The build
system is `make`, any flavour _should_ be fine. For man pages you will require
[__scdoc__(1)](https://sr.ht/~sircmpwn/scdoc/).

__Building:__

Unless you have custom requirements, just use `make`, the following options
are available:

    $ make              # -> dynamic binary
    $ make static       # -> static binary
    # make install      # -> install dynamic binary and man pages to PREFIX

## Usage

### Command Line

Let's start with a few simple examples.

If you want to find all `.c` files recursively from the current directory:

    $ rf \*.c

This is essentially a shortened version of the traditional `find . -name \*.c`.
Underneath rf uses [`fnmatch`](https://man.openbsd.org/fnmatch) so all the usual
glob rules apply. You can also use substring matching instead, something like:

    $ rf -s hello

This would match any files with 'hello' any where in the name. Although this is
less flexible, it can potentially make things easier and faster depending on
the particular use case.