Unix – Going to a specific line number using Less in Unix

less-unixsearchshellunix

I have a file that has around million lines. I need to go to line number 320123 to check the data. How do I do that?

Best Answer

With n being the line number:

  • ng: Jump to line number n. Default is the start of the file.
  • nG: Jump to line number n. Default is the end of the file.

So to go to line number 320123, you would type 320123g.

Copy-pasted straight from Wikipedia.