Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What does this command do?

grep "<[^>]*>" inuux.xml

What is searching for?

share|improve this question
Also about this command grep "<[^>/]*>" – el ab Oct 17 '11 at 3:18
up vote 8 down vote accepted

It can be explained like this:

<         # A literal "<" character
[^>/]*    # Anything that isn't a ">" or a "/", zero or more times
>         # Followed by a literal ">" character

Presumably, this is for matching XML/HTML tags. It certainly isn't the best regex in the world, but it's quick, dirty, and probably works.

share|improve this answer
Parsing HTML with regular expressions -- always a good decision – Michael Mrozek Oct 17 '11 at 6:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.