Coding for All
Level 12: Renaming a File
Renaming a File Give a file a different name.

REN (short for RENAME) gives a file a new name in the same folder. Old name first, new name second. Nothing was printed, which (as usual) means it worked.

Unlike bash, MS-DOS has a separate command for this, because its COPY and MOVE do not do renaming. Bash gets away with one command, mv, for both jobs; DOS keeps them apart.

DIR *.TXT afterwards to see the file has kept its contents and swapped its label.

REN BACKUP.TXT OLD.TXTRename a file.
DIR *.TXTCheck the .TXT files.
Your task
  • Rename BACKUP.TXT to something else
  • Check the listing of .TXT files

Open this level in your browser to type the commands at a live terminal that answers back.