0

Run Command ls on Current Directory and get the output:

    $ ls
    Applications Documents    Library      Music        Public
    Desktop      Downloads    Movies       Pictures

I'd like to enumerate them like:

1. Applications
2. Desktop
3. Documents
4. Downloads
5. Library
6. Movies
7. Music
8. Pictures
9. Public

This could be achieved using less in an intermediate way

ls | less -N

How to enumerate them in a straigtforward way?

AbstProcDo
  • 17,381
  • 14
  • 68
  • 114

1 Answers1

1

You can use nl on the command line:

ls | nl
heijp06
  • 11,182
  • 1
  • 38
  • 59