aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-07 11:10:33 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-07 11:10:33 +1300
commit1cb2b2f7ba93d0b18d1cf82a0c84c11278823dc1 (patch)
tree98ee9462a423436430ed3a143c85335696f33f7b
parentTweak FS for gwp(1df) (diff)
downloaddotfiles-1cb2b2f7ba93d0b18d1cf82a0c84c11278823dc1.tar.gz
dotfiles-1cb2b2f7ba93d0b18d1cf82a0c84c11278823dc1.zip
Add loc(1df)
-rw-r--r--README.markdown1
-rwxr-xr-xbin/loc7
-rw-r--r--man/man1/loc.1df13
3 files changed, 21 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index b591b5f4..b555d65d 100644
--- a/README.markdown
+++ b/README.markdown
@@ -454,6 +454,7 @@ Installed by the `install-bin` target:
* `jfc(1df)` adds and commits lazily to a Git repository.
* `jfcd(1df)` watches a directory for changes and runs `jfc(1df)` if it sees
any.
+* `loc(1df)` is a quick-search wrapped around `find(1)`.
* `maybe(1df)` is like `true(1)` or `false(1)`; given a probability of
success,
it exits with success or failure. Good for quick tests.
diff --git a/bin/loc b/bin/loc
new file mode 100755
index 00000000..642a081c
--- /dev/null
+++ b/bin/loc
@@ -0,0 +1,7 @@
+#!/bin/sh
+if [ "$#" -eq 0 ] ; then
+ printf 'loc: Need a search term\n'
+fi
+for pat ; do
+ find . -name '*'"$pat"'*'
+done
diff --git a/man/man1/loc.1df b/man/man1/loc.1df
new file mode 100644
index 00000000..55890f37
--- /dev/null
+++ b/man/man1/loc.1df
@@ -0,0 +1,13 @@
+.TH LOC 1df "December 2016" "Manual page for loc"
+.SH NAME
+.B loc
+\- find files matching a pattern in the current directory
+.SH SYNOPSIS
+.B loc PATTERN1 [PATTERN2...]
+.SH DESCRIPTION
+.B loc
+is a simple wrapper around find(1) which searches in the current directory tree
+for filenames matching a pattern, and prints them to stdout, newline-separated.
+It is intended only for interactive use.
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>