Do not waste time with grep anymore, use tag


0.00 avg. rating (0% score) - 0 votes


Long time since my last post. This one is not very technical post, but it’s a nice to have solution if you use grep usually. Are not you fed up to type vim <file> and search the line after a grep command ? If yes, this post is for you.

First of all, you may know that an alternative more user friendly to grep exist, called ag (perf comparison). I really like ag and grep, but something make me loose my time since several years and I’m pretty sure it’s your case too.

Let’s say you generally want to parse files, find the information and jump with vim into it. With tag (using ag only) you can do it in only 2 commands. Let say I want to search my username in /etc:

Now if I want to edit /etc/gshadow at line 54 with vim, I only have to type in the terminal:

“e” will read a temporary file containing the result and 10 will ask vim to position in the file to the matching line number.

User friendly and really simple right ?

Hope this will help

Author: Deimos

I'm a passionate DevOps. I love transmit my skills and I love working on high availability infrastructures/technologies.

Laisser une réponse