Assume you have a list of files with random base names, some of of them have a order such as the following input example. I really would like to do this by nl/seq/..., not by some loop approaches as proposed in the thread Renaming files in a folder to sequential numbers.If no series found in basenames, then alphabetical order1.jpg, 3.jpg, 4.jpg, 7.jpg, blooremaa.jpg, bloraem.jpgExpected output1.jpg, 2.jpg, 3.jpg, 4.jpg, blooraem.jpg, blooremaa.jpgPseudocodejust get a list of filesrename them by an increasing seriesPseudocode attempt where the last part makes a change in the filenames of the list of files# http://unix.stackexchange.com/a/332413/16920ls *.jpg | ... TODO ...                      \  | sed 's/ *\([0-9]\+\)\.\(.*\)/\2 \1\.\2/' \   | xargs -n 2 mvOS: Debian 8.5     
How to rename by a sequence in seq/nl/...?
shell script;awk;rename