Question: I want to get a numbered list of files, e.g. if I have these files:

```
a.pdf
b.pdf
c

```

then it should be listed as:

```
1 a.pdf
2 b.pdf
3 c

```

Answer: 
If you want to [avoid parsing the output of `ls`](http://mywiki.wooledge.org/ParsingLs) (which you do), you can do something like this:

```
$ counter=1; for f in *; do printf "%2d %s\n" $((counter++)) "$f"; done
 1 a.pdf
 2 b.pdf
 3 c

```

I only mention this because it's the path for doing more sophisticated things, not just enumerating.
You can do this without awk, trivially. `ls -1 | cat -n`.

Or, with awk:

```
ls -1 | awk '{printf "%d %s\n", NR, $0;}'

```