I have a script and i'm using this to find and list files that end with .txt in the tmp folder
find /tmp -type f \( -name '*.txt' \) |cut -c14-
The output is something like this:
xpto.txt
abc.txt
xyz.txt
But i want to add an index at the beggining of each line
1 - xpto.txt
2 - abc.txt
3 - xyz.txt
Can anyone help me? i'm still learning bash, started 1 month ago.
man nl