[Computer Getting Started] Folder (directory) and path

2.7 Folder (directory) and path

A folder (folder, directory) is a container for storing and organizing files and other folders. It can contain any number of files and subfolders, which can be moved, copied and managed by operations such as drag and drop, copy and paste.
Windows folders can help users better organize and browse their files and documents, and provide a view of all files and directory structures on the computer. In the Windows operating system, each user has his own folder where private files and folders can be kept.
Generally, the computer has 3-5 disk partitions after the system is installed. If there are many files to be stored and it is easy to manage, some different types of files need to be stored separately, so folders are needed. If there are too many files to manage, then you need to create subfolders under the folder, and so on.

2.7.1 Path

In operating systems, a path is a generic representation of the name of a computer file or directory that points to a unique location on the file system.
Paths can be divided into 绝对路径and 相对路径. An absolute path is a full path starting from the root directory, and a relative path is a partial path starting from the current directory. A string of strings that connect directories and subdirectories like: is called a path, indicating the location of a certain folder. Generally, if the path starts from the drive letter C, D, etc., it is called an absolute path. For example, the absolute path of the file in the figure below is:
绝对路径

C:\Users\document\abc.txt
test1.txtE:\Temp\Share\text1.txt
insert image description here

相对路径
A relative path refers to the location of a file or directory counted from the current working directory. Relative paths can be represented using the following notations:

  • .: Indicates the current directory.
  • ..: Indicates the parent directory.
  • \: Indicates the root directory (usually the root directory of the system disk, such as C:\).
  • 文件夹名: Indicates a subfolder under the current directory.
  • 文件名: Indicates the files in the current directory.

For example, assuming that the current working directory is D:\Documents\, if you want to find a subfolder named "images" in this directory, you can use a relative path; if you want to find a file named "example.txt" in the .\images\parent directory, you can use a relative path ..\example.txt.

Guess you like

Origin blog.csdn.net/crleep/article/details/131801711