about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRory Bradford <roryrjb@gmail.com>2019-12-28 08:18:24 +0000
committerRory Bradford <roryrjb@gmail.com>2019-12-28 08:18:24 +0000
commit0aaa3fc4eb7b186b7413c6efe24120e965e132e7 (patch)
treed99859f2ce272261cf48439537fa2888ac350641
parentb5d38bf5fd730dac90455d66d9b2696e9ef8ac0e (diff)
downloadrf-0aaa3fc4eb7b186b7413c6efe24120e965e132e7.tar.gz
Additional usage documentation
Signed-off-by: Rory Bradford <roryrjb@gmail.com>
-rw-r--r--rf.123
1 files changed, 19 insertions, 4 deletions
diff --git a/rf.1 b/rf.1
index 6ace09f..f1ed3e6 100644
--- a/rf.1
+++ b/rf.1
@@ -44,10 +44,10 @@ Files and directories can be found using very simple patterns.
 .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
+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.
@@ -55,6 +55,21 @@ 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),