Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

1 Answer 1

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.