Reputation: 2790
I am trying to search for any string of say more than 200 characters without any space character in between.
I have tried multiple options, but nothing seems to work.
for example
grep -r '.{200,}' /directory/sub-directory/
grep -r '[^\s.]{200,}' /directory/sub-directory/
Upvotes: 0
Views: 675
Reputation: 146
grep -o -E '\S{200,}' -r /directory
The rest you had already
Upvotes: 1
Reputation: 6517
The {n,m}
specifier requires extended regexes (grep -E
), and if you want anything but space, [^ ]
should do. Also, "more than 200" is the same as "at least 201", so:
grep -rEe '[^ ]{201,}' path
Upvotes: 1