Table of contents
2. The difference between relative paths and absolute paths
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]
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.txt
if 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
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