[Super invincible and detailed Han Shunping's java notes] From entry to proficiency---dos command

Table of contents

1. Basic principles of DOS

2. The difference between relative paths and absolute paths

3. Commonly used DOS commands

1) Check the contents of the current directory dir

2) Switch to another disk: disk symbol cd: change directory

4) Switch to the previous level: cd..

5) Switch to the root directory: cd \

6) View all sub-directory trees (directory tree) under the specified directory

7) Clear screen cls [Teacher Cang]

8) Exit DOS exit

9) Commonly used instructions


1. Basic principles of DOS

 

2. The difference between relative paths and absolute paths

Both relative paths and absolute paths are used to locate files or folders.

 

  • A relative path is a path formed by starting from the current directory.

For example, if the current working directory is \abc\test2\and the file to be accessed is hello.txt in the test200 folder under the abc2 folder under the D drive, the relative path is ..\..\abc2\test200\hello.txt.

  • An absolute path is the full path to a file or folder, starting from the root directory.

For example, \abc2\test2\hello.txtif the file is located in D:, the absolute path is D \abc2\test2\hello.txt:.

  • The difference is that the relative path is based on the path of the current working directory, and the relative path can be relative to the directory where the current file is located, or it can be relative to the path of the current working directory. Absolute paths always point to a specific file or folder.

3. Commonly used DOS commands

1) Check the contents of the current directory dir

you d:\abc2\test200

 

2) Switch to another disk: disk symbol cd: change directory

Case demonstration: switch to c drive
cd /D c:
3) Switch to other directories on the current disk ( use relative paths and absolute paths for demonstration ), ..\ represents the upper level directory (if it reaches the top level, it will not move and no error will be reported)
Case demonstration: cd d:\abc2\test200 cd ..\..\abc2\test200

4) Switch to the previous level: cd..

Case demonstration: cd ..

5) Switch to the root directory: cd \

Case demonstration: cd \

 

6) View all sub-directory trees (directory tree) under the specified directory

7) Clear screen cls [ Teacher Cang ]

8) Exit DOS exit

9) Commonly used instructions

md[ create directory ]
rd[ delete directory ]
copy[ copy file ]
del[ delete file ]
echo [ input content to file ]
type[input empty content to file]
move[ cut ])

 

 

 

 

Guess you like

Origin blog.csdn.net/qq_45206556/article/details/131683200