Reputation: 24248
I have file that contains:
# sdfdsfds fsf
var1=1232
#fdsfdsfds
#fdsfsdf
var2=456
..................
I need select only not commented rows - that not start from # Does it possible with grep? Thanks.
Upvotes: 0
Views: 116
Reputation: 57650
Use the -E
option for regex and -v
option for inverse matching.
grep -v -E '^#' file
Upvotes: 0
Reputation: 161674
use the -v
(invert-match) option in grep
:
$ grep -v '^#' file.txt
var1=1232
var2=456
Upvotes: 5