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