Count Lines Viewed from command 'less'
According to its man page:

-N or --LINE-NUMBERS
      Causes  a  line  number to be displayed at the beginning of each
      line in the display.


So:

ls /usr/bin | less -N
  1 2to3
  2 2to3-
  3 2to3-2.7
  4 2to32.6
  ....