Some good find alias.

2020-08-23 1 min read Learning bash

Here are some interesting alias’s that you may want to add to your bashrc file or where-ever else you add your aliase’s. Very useful if you use find commonly.

There are four aliases defined here and have a comment explaining what it does. but these are so simple and useful that you probably dont even need the comments.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

# ff:  to find a file under the current directory
ff () { find . -name "$@" ; }
# ffs: to find a file whose name starts with a given string
ffs () { find . -name "$@"'*' ; }
# ffe: to find a file whose name ends with a given string
ffe () { find . -name '*'"$@" ; }
# very very useful function: for finding files with ignore case, just type "f <part of filename>"
# This in combination with alias for 'g' is deadly.
#
f () { find . -iname '*'"$@"'*' ; }

Hope this is useful for you.

comments powered by Disqus