Grep is a large number of commands used to analyze data files, while "-- color = auto" is included in the grep Parameter options to highlight the captured data, specifically, specifying the color is controlled by the grep_color variable. Here we will not go into details. You can refer to the man manual for details. We usually mark the color when grep captures data and write "-- color = auto" so long parameter options will be more troublesome, in normal times, you can modify the bashrc file in the home directory to add an alias to grep so that it can automatically mark the color as LS. The modification is as follows:
[[Email protected] ~] # Vim ~ /. Bashrc... ... Alias grep = 'grep -- color = auto' # source global definitionsif [-F/etc/bashrc]; then./etc/bashrcfi [[email protected] ~] # Source ~ /. Bashrc # Of course, if you want global settings, you can put them in the following [[email protected] ~] # Echo "alias grep = 'grep -- color = auto'"> ~ /. Bashrc; source ~ /. Bashrc
This article is from the "Technical essay" blog, please be sure to keep this source http://jim123.blog.51cto.com/4763600/1875424
Some Suggestions on setting alias for grep in UNIX