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 your system has command `nl`, it will be easier. ( I can confirm `nl` command is exist in cygwin, aix and solaris system, then it should be popular command in most unix system)

```
ls |nl

```
You can do this without awk, trivially. `ls -1 | cat -n`.

Or, with awk:

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

```