diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-07 11:10:33 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-07 11:10:33 +1300 |
commit | 1cb2b2f7ba93d0b18d1cf82a0c84c11278823dc1 (patch) | |
tree | 98ee9462a423436430ed3a143c85335696f33f7b | |
parent | Tweak FS for gwp(1df) (diff) | |
download | dotfiles-1cb2b2f7ba93d0b18d1cf82a0c84c11278823dc1.tar.gz dotfiles-1cb2b2f7ba93d0b18d1cf82a0c84c11278823dc1.zip |
Add loc(1df)
-rw-r--r-- | README.markdown | 1 | ||||
-rwxr-xr-x | bin/loc | 7 | ||||
-rw-r--r-- | man/man1/loc.1df | 13 |
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> |