Reputation: 4877
How do I match a line with no space in grep? For example,
xyz
a b c
d e f
Only xyz should match. The pattern ^\S*$
does not seem to be working.
Upvotes: 0
Views: 2759
Reputation: 26667
Something like
$ grep '^\S*$' input
xyz
OR
$ grep '^[^ ]*$' input
xyz
Upvotes: 2