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