How to rename the file in the command line

How to rename the file in the command line

The command line – the powerful tool which allows to make any operations with the files which are stored in a system. During the work via the terminal often there is a need to make basic conversions – to rename the document or to move it to other directory. The corresponding commands are for this purpose used.

Instruction

1. Open a window of the command line. For this purpose open the Start menu and pass into the section "All Programs". In the offered list select "Standard" - "Command line". You can also execute loading of the utility, having started "Start-up" and having manually entered request "Command", and then having selected the corresponding result.

2. The window of the terminal in which you and will need to enter all commands will appear. Install the cursor in the top part of a window. Then it is necessary to define the full address to the file which you want to rename. For this purpose via the graphic interface click with the right mouse button on the target document, and in the appeared menu click "Properties". In a line "Arrangement" the full path of the document which and will need to be specified in the command line will be specified.

3. Return to the terminal and enter request:

rename disk: put_do_fayla\iskhodnoye_imya_fayla of a zhelatelnoye_imya_fayl

In this case "disk" - the name of logical partition on which the document is located. Path to the file represents the sequence of folders in which there is the necessary document with the name "iskhodnoye_imya_fayl". The zhelatelnoye_imya_fayl value matches the name which you want to give to the document.

4. For example, there is a document with the name file.txt which is in the Loadings folder of the user of Sasha of a system. That to rename it into otchet.txt, in the command line it will be necessary to enter the following request:

rename C:\Users\Sasha\Downloads\file.txt otchet.txt

5. After input of a command click Enter and wait for the end of operation. If it was not displayed any errors at command execution, the procedure means it was performed truly and renaming was successfully complete.

6. In the command line you can rename and at the same time move the document. This operation becomes by means of the move command which has syntax:

move of a put_do_iskhodnogo_fayl of a put_do_novoy_directoriya.

Author: «MirrorInfo» Dream Team


Print