Either this is a bug, or I'm not understanding something. But I use less -p value filename.txt to search for value in filename.text and when I do it for a file that only contains a couple of lines of text, it finds it promptly and then highlights the result.
However, I'm also using less to search in a 73GB file. I'm confident the search result is in the file, still, less stops searching at a random location but doesn't highlight its result. Actually, upon closer inspection of that frame, the text string is nowhere to be found either.
Is this expected behavior of less or what is going on here?
I'm able to exclude running out of memory as a cause, I measured memory using ps aux and checking the process' proc file but for ps aux it was 0.0 percent and VimSize was 18432 kB
I'm also using **less** to search in a 73GB file. Dear God, why? Use something like grep or something. But, to answer your question, check how much memorylessis using-- I know that less doesn't pull the entire file into memory, but using it to search for a phrase might use more. – Barry Carter Aug 15 '22 at 13:46tidy -jsonorjson_xsorjson_ppcould break it into shorter lines with would help bothlessandgrep. Also, if your search strings are fixed, you can usefgrepwhich is faster. Also, when you do find the errors, how do you plan to edit the file? – Barry Carter Aug 15 '22 at 13:54ps auxand before I fed less with a search string for the big file.px auxreported no memory use0.0.vmSizein the proc file of the process was 18432 kB. – Tim Daubenschütz Aug 15 '22 at 13:58straceto see where it crashes-- I'm guessing it's doing a lot oflseeking and perhaps evenmallocing (although your measure of its memory size remaining stable as it runs sort of rules that out) – Barry Carter Aug 15 '22 at 14:04sedorawkscript. But I'll have to fix the file in many places and escaping and matching json is a ton of work such that I believe a text editor that supported large file editing would truly be the solution here. Does this exist? – Tim Daubenschütz Aug 15 '22 at 14:06