Some Suggestions on setting alias for grep in UNIX

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.