This Season
 

How to Change File Extensions in Command Prompt

Windows operating systems have the MS-DOS command prompt that allows you to manipulate---copy, delete and rename---files. In Linux, such commands are available via a terminal window. The way to change the file extension in both Windows and Linux is to rename a file providing the new extension.

Related Searches:
    Difficulty:
    Easy

    Instructions

    Things You'll Need

    • PC with Windows XP/Vista or Linux
    1. In Windows XP/Vista

      • 1

        In Windows XP/Vista, click "Start." Click "Run" (only Windows XP). Then type "cmd" and press "Enter" to open the command prompt window.

      • 2

        In the MS-DOS shell window, type "cd c:\path\to\file" and press "Enter." Example:
        cd c:\user\test. If the designated file is on a different logical drive (e.g., on drive D) type "d:" and press "Enter." Then type the "cd" command as above.

      • 3

        Type "dir" followed by "Enter" to list the directory content and find the designated file.

      • 4

        Type "rename filename.ext filename.new" and press "Enter"; ".new" is the new file extension ("filename.ext" stands for any file you might have; for example:
        rename report.txt report.doc).

      In Linux

      • 1

        Right-click on Desktop and choose "open terminal" from the pop-up menu.

      • 2

        Type "cd /path/to/the/file" followed by pressing "Enter" to navigate to the directory having the file. Example: cd /home/tom/doc.

      • 3

        Type "ls *.ext" and press "Enter" to list all files with the extension "ext," and confirm the file exists in this directory. For example: ls *.txt.

      • 4

        Type "mv filename.ext filename.new" and press "Enter" to change the extension. For example,
        mv report.txt report.doc.

    Tips & Warnings

    • A filename must not contain spaces to be renamed via the command prompt.

    Related Searches

    Resources

    Read Next:

    Comments

    You May Also Like

    Follow eHow

    Related Ads