Grep for beginning and end of line?

后端 未结 6 1218
-上瘾入骨i
-上瘾入骨i 2020-12-04 20:50

I have a file where I want to grep for lines that start with either -rwx or drwx AND end in any number.

I\'ve got this, but it isnt quite right. Any ideas?

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-04 21:29

    It looks like you were on the right track... The ^ character matches beginning-of-line, and $ matches end-of-line. Jonathan's pattern will work for you... just wanted to give you the explanation behind it

提交回复
热议问题