

You can also search for lines not containing a pattern with /!. navigate using up/down arrows, space (one page down), b (one page back).

Once you are viewing the file in less, you can: Remember you can type less -n (don't forget the final space) and drag-and-drop the file from the Finder to the Terminal window to add the path to that file. You probably should add the -n option to prevent less from trying to compute line numbers. It will show you one page at a time of the file, will only load about that much in memory, so you can navigate multi-TB files with it if you want. Launch the app from spotlight and drag your monster file on the window to have a peek. In your case, the console app that comes with macOS might also be worth looking at if you can use the search functionality there. (And bat gives you wings awesome colors and syntax awareness). Also, a pager like less or more or bat is also very friendly to get started and navigate around massive files.
#HOW TO READ A .TXT FILE ON MAC HOW TO#
I also use vi to edit things, but that opens a can of worms for needing the shell, terminal app or another app and some studying to learn how to exit the editor (tldr try ZZ or ZQ), customize it and teach your brain to think about operating on text in the abstract as opposed to using the mouse to select items. Once you have it, you can also pay up for the pro / automation / out of gratitude features, but it's free forever if you want and like that price. In terms of your immediate needs, the best free visual editor for macOS is BBEdit (linked to the Mac App Store download) and it does so much - a true powerhouse.
