OS: FreeBSD 8.2, bash
Hey guys,
I’m stumped as to why I can’t grep the the line with / partition from df:
/dev/amrd0s1a 1012974 452694 479244 49% /
I want to be able to grep that line only, (other lines have slashes too) so I figured one of these would work:
df -m | grep -E '\<'/'\>'
df -m | grep -E '\</\>'
df -m | grep -E '\<"/"\>'
but neither of those work, I was wanting to do it this way so I could practice using the ‘\< \>’. I tried with out the -E as well.
Can this be done? What am I doing wrong?
Thanks in advance!
The problem is that
\<and\>are for word boundaries, but/is not a word character. Instead match the preceding whitespace and following EOL:[[:space:]]/$.