Understanding UNIX and Linux Regular expressions (regex)

last updated in Categories Debian Linux, Gentoo Linux, Howto, Linux, Tips, Ubuntu Linux, UNIX

Trust me, if you know regex very well you are a UNIX guru. Regex is nothing but a string that is used to describe or match a set of strings, according to certain syntax rules.


Many new user think that learning to use regex is difficult, but if you know the fundas (read as basics) it is actually quite easy. Remember you can use regex not just under UNIX but also under PHP, Perl, VB.NET and many other modern programming languages.

This article offers some good introduction for finding and manipulating text using regex:

Virtually all non-trivial problems require you to filter good data from bad. Discover the many UNIX(R) command line utilities that use regular expressions to discern the relevant from the irrelevant.

=> Speaking UNIX, Part 9: Regular expressions


Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.