As title says, what does grep ^- mean in UNIX? I know what grep is but not the metacharater ^- part.
What does grep ^- mean in UNIX?
2.9k views Asked by Sunny At
3
There are 3 answers
0
On
It matches the beginning of a line or string. Please check the list of meta characters supported by different Linux programs here - http://docstore.mik.ua/orelly/linux/lnut/ch09_02.htm
Hope this helps.
^
is the regular expression meta character for start of line-
in this context is not a metacharacterThis expression therefore matches any - character at the start of a line and with grep will return any line starting with -
will match
Won't match