rename file in terminal code example

Example 1: how to rename a file in ubuntu using terminal

mv oldnamefile1 newnamefile1

Example 2: rename command ubuntu

cd /home/user/docs/files
mv file1.txt file2.txt

Example 3: how to rename a file in terminal

mv "old location" "new location"

mv /home/user/my_static /home/user/static

mv "file1.ext" "file2.ext"

Example 4: change file name in terminal

mv oldfile.txt newfile.txt

Example 5: change file name in terminal

rename 's/.prog/.prg/' *.prog

Example 6: rename set of files terminal linux

$ mmv a\* b\#1