Q:

How to rename multiple files with different names at once?

I have several docx files (approximately 250 files) each one with a different name. I need to rename all these files so that the result has to be that each file name must be a consecutive number for the previous file, as follows: 
1.docx - 2.docx - 3.docx - etc.
How can I do this using the command line in my Linux?
My biggest problem is that each file has a completely unreadable name.
For example: 
ÄÿÇä ÄùàÄàÜ ÄæÆë ÜÖÆà.docx
Because these files were originally named in Hebrew and when the zip file was extracted the files were given illegible names.

A:

Try:
count=0; for f in *.docx; do mv -i -- "$f" "$((count=count+1)).docx"; done

If there was a chance that one of the original files was actually named with a simple number, like 3.docx, then it is safer to move the files to some other directory at the same time that they are being renamed:
count=0; for f in *.docx; do mv -i -- "$f" "some/other/dir/$((count=count+1)).docx"; done

How it works

count=0
This initializes the variable count to zero.
for f in *.docx; do
This starts a loop with f being assigned to the name of each docx file in turn.
mv -i -- "$f" "some/other/dir/$((count=count+1)).docx"
This renames/moves the files.  $((count=count+1)) tells the shell to increment the count each time.
Under bash, $((count=count+1)) can be simplified to $((++count)).
done
This signals the end of the loop.

