Windows command line text manipulation

For file operations under Windows, most of the time you use Windows Explorer (that is, the graphical interface you see when you double-click "My Computer").

Next, take text manipulation under the Windows command line as an example to see how powerful the command line is in manipulating files.

1. Enter the directory for testing: E:\Test, there are no subdirectories and files in the Test directory at this time.

 

 2. Execute md AA and md BB in the Test directory to create two folders AA / BB (or, use the mkdir command).

3. Switch to the AA directory, and use the echo command to write "Hello1" to 1.txt and "Hello2" to 2.txt.

 

You can use the type command to view the contents of the file, such as viewing the contents of the 1.txt file:

 

4. Use the copy or type command to concatenate the contents of the two files into a new file.

COPY

TYPE

 

 5. Use Rename to rename a file.

First, create a file called hello.txt; after that, use the rename command to rename hello.txt to hello_rename.txt 

6.Copy a file to another directory

7.Move a file to another directory

8.Del, delete a file

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325038960&siteId=291194637