Can I make my own custom grep search tool?
man grep
will give you information about how to use grep. The -i
option will do what you were looking for: ignore case. Thus, a command
lspci | grep -i nvidia
would have retrieved NVIDIA.
If you want to make your own tool, an easy way is to define an alias:
alias 'grep=grep -i'
This customized grep
command will imply the -i
option each time you run grep
. After defining the alias, your original command would have worked the way you wanted. No need to further program your own tool.
This alias definition is valid for the current session only. To enable the option permanently, open your ~/.bashrc
file with a text editor and add the -i
option in the alias
definition that is there already:
alias grep='grep -i --color=auto'