The shortest command line for this that I can think of is
ls | cat -n | while read nf; do mv "$f" "file-$n.jpg"; done
ls lists the files in the current directory, and cat -n lists the line numbers. The while reads the resulting numbered list of files line by line, stores the line number in variable n and the file name in variable f and renames it.
source share