It would help if you gave a few more details. What constitutes a "string"? Do you mean whitespace-delimited characters? Whole lines? What? Perhaps you could give us a bit of sample text?
The suggestion given above searches for strings of 50 or more consecutive non-space characters. You can avoid the backslashes, however, by using the "
-E" extended regex option, and you don't need to use "
-e" when there's only a single expression.
Code:
grep -E '[^[:space:]]{50,}' /path/to/file
Notice that I also replaced the simple space with the "
[:space:]" character class, which covers all whitespace characters.
"
[^\ ]" is wrong in either version, BTW, as it means "not a backslash or a space". All simple characters are considered literal when inside a regex bracket expression except for "
^","
-", and "
]", and even those are made unspecial by placing them in certain positions inside the brackets (i.e. "
^" is only special if it's the first character in the list).