What Is a Physical Address Extension?
When a file system contains many levels, a full path name including the name of each intermediate node (directory) is used from the root of the tree to the leaves (data files) each time a file is accessed. This is quite troublesome, and because the files accessed by a process are mostly limited to a certain range, it is very inconvenient. Based on this, you can set a "current directory" for each process, also known as a "working directory." The process accesses each file relative to the "current directory". At this time, the path name used by each file only needs to start from the current directory, step through the intermediate directory files, and finally reach the data file to be accessed. The current directory is the directory that is currently in use or frequently used.
- in
- The organization of the directory structure is related to the access speed of the file system, and also to the sharing and security of the file. Therefore, organizing the file directory is an important part of designing a file system. At present, the common directory structure forms are single-level directories, two-level directories, and multi-level directories.
- In the tree-like directory structure, there is only one unique path from the root directory to any data file. Starting from the root of the tree (that is, the home directory) on this path, all directory file names and data file names are sequentially connected with "/" to form a path name of the data file. Each file in the system has a unique path name. The path name formed from the current directory to the data file is called a relative path name (relative path name); and the path name from the root of the tree is an absolute path name.
- When a user wants to access an existing file, the system first searches the directory using the file name provided by the user to find the file control block or corresponding index node of the file; then, according to the file recorded in the FCB or index node The physical address (disk block number) is used to convert the physical location of the file on the disk. Finally, the required file is read into the memory through the disk driver. There are currently two ways to search the directory: the linear retrieval method and the hash method.
- Command 1: mkdir
- Purpose: Create a directory
- Example 1: mkdir do
- Meaning: Create a subdirectory named do under the current directory
- Example 2: mkdir do / align
- Meaning: Create a subdirectory named align under the subdirectory do (the subdirectory do already exists)
- Example 3: mkdir p hba / tree
- Meaning: Create a subdirectory named hba under the current directory and create a subdirectory named tree under the subdirectory hba
- Command 2: rmdir
- Purpose: Delete directory
- Example 1: rmdir tmp
- Meaning: Delete the subdirectory named tmp in the current directory. There are no files and subdirectories in the subdirectory.
- Command 3: cd
- Use: change directory
- Example 1: cd
- Meaning: Return to the user's home directory, which is the directory entered when logging in
- Example 2: cd do
- Meaning: Enter the subdirectory do
- Example 3: cd ..
- Meaning: Return to the parent directory
- Example 4: cd hba / tree
- Meaning: Go directly to the tree subdirectory under the subdirectory hba
- Example 5: cd ../do/align
- Meaning: Enter the align subdirectory of the parent directory do
- Command 4: ls
- Purpose: Display files or directories
- Example 1: ls
- Meaning: Display subdirectories and file names in the current directory
- Example 2: ls -l
- Meaning: Display detailed information of subdirectories and file names under the current directory, including attributes, permissions, size, creation date, etc.
- Command 5: rm
- Purpose: Delete files or directories
- Example 1: rm seq2
- Meaning: delete file seq2
- Example 2: rm * .txt
- Meaning: Delete all files ending in .txt
- Example 3: rm -r temp / *
- Meaning: Delete all subdirectories and files in subdirectory temp, keep this directory
- Example 4: rm -r temp
- Meaning: Delete the subdirectory temp and all subdirectories and files in the directory
- Command 6: chmod
- Purpose: change file or directory permissions
- Example 1: chmod w ppf1.fas
- Meaning: Cancel write permission for pf1.fas for all users
- Example 2: chmod + w seq1
- Meaning: Set seq1 in the current directory as writable by this user, and the permissions of other users remain unchanged
- Example 3: chmod -w keep /
- Meaning: Cancel keep write permission on a subdirectory, you cannot create or delete files or subdirectories in this directory
- Example 4: chmod 755 bin / *
- Meaning: Set all files in the sub directory bin to be readable and writable by the user and executable by other users [3]