rename command a file in linux code example Example 1: bash rename file mv oldname newname Example 2: rename a file in linux mv oldfile.txt newfile.txt