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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
.TH rf 1
.SH NAME
rf \- A tiny and simple file finder
.SH SYNOPSIS
.B rf
[OPTIONS] PATTERNS...
.SH DESCRIPTION
.B rf
will find files based on simple substring patterns.
.SH OPTIONS
.TP
.B "\-h, \-\-help"
.br
Show help message.
.TP
.B "\-V, \-\-version"
.br
Show version.
.TP
.B "\-b, \-\-basename"
.br
Only show the basename of results.
.TP
.B "\-v, \-\-invert"
.br
Invert matches.
.TP
.B "\-\-limit=[n]"
.br
Limit to [n] matches. The default is 0 which will return all matches.
.SH PATTERNS
Files and directories can be found using very simple patterns.
.TP
.B "Substrings"
.br
A simple string is basically a substring match. So if you supply a
pattern of "js", rf will match any file that contains the string "js"
anywhere in the filename. If the pattern is ".js" it will match any
".js" or even ".json" files for example, as well as the filename
"script.js.backup", in other words the character "." is just that, it
doesn't have any special significance such as in regular expressions.
It also doesn't have any kind of implicit positional information, it
will just match at any point in the filename.
.TP
.B "Beginning and end"
.br
There are two characters which are treated as special. The caret
character "^" signifies *at the beginning of* the filename. So for
example if you specify the substring of "bar" it will match the
files "bar", "barbar", "foobar" and "foobarbaz", as that substring
appears at some point in the filename. If you specify the substring
of "^bar" it will only match the files "bar" and "barbar" as that
substring only appears at the beginning of those filenames.
On the other side, if you use the dollar character "$" it will only
match if at the end of the filename. So in the previous example if
you specified "bar$" it would match both "foobar" and "barbar".
You can use these characters in combination to only match the whole
string. So with our imaginary directory above, specifying "^bar$" will
only match the file "bar".
.SH SEE ALSO
.BR find (1),
.BR rg (1)
.SH COPYRIGHT
Copyright \(co 2019 Rory Bradford <roryrjb@gmail.com>.
|