If I have a directory, how do I add the number of the file to beginning of the filename? For example, the directory would look something like this:
file.txt
another_file.txt
And the expected output would be:
1_file.txt
2_another_file.txt
Is there a way to do this? I've seen this post, but I amn't sure how to change the prefix for each file (in this example, have it increase by one each time).
ls | nl ...
=> seeman nl
– Wiimm Feb 09 '19 at 00:25