I was wondering what does the <> do in a grep command
grep a b c, try to find
grep <html> foo?
What does the
<> do? Find the HTML tags?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
When inside quotes...
grep '<html>' foo grep "<html>" foo
...it does exactly that: find a
<html> tag inside the
egrep use POSIX regular expressions, which are described in the manual page of
regex(7) – basic for
grep, extended/modern for
egrep. Neither version treats
When not inside quotes, however, it doesn't do anything useful.
grep <html> foo grep < html > foo
Most commonly used shells will treat the above equally: run command
grep with no arguments, reading from file named
html, writing to file named
foo. But this won't work, because there is no "pattern" to be given to
grep, so you'll get an error message (and an empty