Use `less` to view and search huge files

Every now and then I’ll have to search through a 10MB or 20MB SQL dump for something, and historically I’ve just used Gedit for this, even though it can take minutes to open it and scrolling is pretty much unusable.

Today, I discovered that if all you’re doing is viewing it and searching it, then less is definitely the way to go. It opens instantly and you can use vim syntax to search through it. Try it:

less your_huge_file.txt

Then just type /searchterm and hit enter to search, then n to cycle through the results.