Skip to content

Commit 2ff9321

Browse files
committed
findi helper function
1 parent 6758b96 commit 2ff9321

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

functions

+15
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,18 @@ find-up () {
2121
# echo "$path"
2222
# }
2323

24+
findi () {
25+
if [[ $# -eq 0 ]]; then
26+
echo 'Simplifies use of find -maxdepth 1 -iname "*...*"'
27+
echo 'Usage: findi [path] "<wild-card term>"'
28+
echo 'e.g. findi ~ ".c*"'
29+
return 1
30+
fi
31+
path="."
32+
if [[ $# -ge 2 ]]; then
33+
path=$1
34+
shift
35+
fi
36+
find $path -maxdepth 1 -iname "$1" 2> /dev/null
37+
}
38+

0 commit comments

Comments
 (0)