![]() You just need to know that grep with a flag can use regular expressions or perform an exact search. It makes more sense to use flags for a tool to provide similar behavior. ![]() Josevnz:x:1000:3000:josevnz:/home/josevnz:/bin/bash Why were egrep and fgrep replaced? Here is a comparison: $ fgrep 'josevnz' /etc/passwd ![]() The fixed grep command uses a fixed string for matching (no optimizations, so it is faster than a regexp) as opposed to -E. Josevnz:x:1000:3000:josevnz:/home/josevnz:/bin/bashīoth examples match the lines that start with the letter j or f in the /etc/passwd file.Īnother example of adding a new flag is fgrep. For example: $ egrep '^' /etc/passwdįtp:x:14:50:FTP User:/var/ftp:/sbin/nologin However, egrep was deprecated in favor of using regular grep with the flag grep -E. The egrep ( extended grep) tool uses regular expressions to match a line. Write programs to handle text streams because that is a universal interface. Write programs that do one thing and do it well. The venerable grep command is one of the best examples of the philosophy of the Unix operating system: These tools are also well maintained. So here is my list, in no specific order. This article shares a handful of older tools that you might be still using, what you should be using instead, and why you should switch to these improved alternatives that provide the same functionality, if not more. How well do you know Linux? Take a quiz and get a badge.Linux system administration skills assessment.A guide to installing applications on Linux. ![]()
0 Comments
Leave a Reply. |