Getting around *extremely* long lines in less

less

When navigating log files with less (e.g., using Space and B), sometimes I run into extremely long lines, as in 120,000 characters long long. It gets slow to navigate around these, I guess because it has to figure out what can go in the terminal and where to put the line breaks.

Everywhere else in my log files the lines are only wrapped at the very most maybe 10 times, never more than a page, that's for sure. So I don't want to do something drastic like not wrap the file.

Is there a way to go to the end of these lines when I hit them?

Best Answer

Originally I tried /\n, but the correct way to find end-of-lines is /$. (Remember, in regex ^ is the start of the line and $ the end, \n finds the n's.)

In case you are navigating up, use ?^ instead, this skips to the start of the line.

Related Question