I try to write grep alias exclude log files
alias gr='grep -R --exclude=\*.{log,0,1,2,js} "$1" *'
alias gr='grep -R --exclude=\*.{log,0,1,2,js} $1 *'
Doesn't work correct
I need to make something like gr "sometext"
You cannot use arguments ($1
) in an alias. Use a function instead.
function gr { grep -R --exclude=\*.{log,0,1,2,js} "$1" * ; }
This should work.