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