To display line numbers while using the less command, you can add the -N option when running the less command:
less -N file.txt
In this example, the -N option causes less to display line numbers in front of each line of the file. This can be useful when you need to refer to specific lines in a file.