Is there a quick way to list all the files from a location having an appended order number?
something like:
ls -a
generates the result:
1 file a
2 file b
...
100 file whatever
Thanks.
P.S. I need this because I am exporting a list to a file, and I have to analyse those files, and it would help me to be able to identify the files.
From the terminal use the following command:
yes there is. just pipe
nl
to the end of the your command:In this case you should write in this way:
and the result is :
nl
refers to number line of files.also look at here :) http://www.sitepoint.com/15-little-known-unix-commands/?
Karel's answer is fine for most cases but it will break in the unlikely case where your file names contain newlines. For a more robust approach use
stat
instead:or find
and a
while` loop: