0

I have created the following alias in my .bashrc file:

alias find='find . -type f -name'

This obviates the need to type . -type f -name every time I do a file search. However, I still have to enclose search strings with '*...*'. How could I include these in the alias, so that instead of having to type:

find '*string*'

I could just type,

find string
Edman
  • 492

1 Answers1

2

It is not easy with an alias but you can just define a shell function instead.

find() { /usr/bin/find . -type f -name "*$1*"; }