I have an output like this:
JavaScript
x
a/foo bar /
b/c/foo sth /xyz
cc/bar ghj /axz/byz
What i want is just this line:
JavaScript
a/foo bar /
To be more clear, I want those line ending with a specific string. I want to grep
lines that have a /
character at their last column.
Advertisement
Answer
You can use $
like this:
JavaScript
$ grep '/$' file
a/foo bar /
As $
stands for end of line, /$
matches those lines whose last character is a /
.