In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
The file data consists of two parts: metadata and data, which are stored in the metadata space and the data space respectively.
0 each new file will be systematically assigned an iNode node number equivalent to a human × × number which is unique in a partition, and the pointer to the space occupied by different inode numbers will point to different data.
For example, create a file F1 with a size of one G in / home and copy the F1 file to the current folder f2
The experimental results show that the two files occupy a total of 2G of space, which means that the pointer of F1 and the pointer of f2 do not point to the same data space. If the pointer of two files points to the same data space, then the space occupied by the two data is 1G, but the experimental results take up 2G of space on the contrary.
1 mode permission
The group to which the user of 2ownership belongs
3 timestamp information (read time atime, modification time mtime, ctime between jian when attributes are modified)
4 there are 12 direct pointers, and one pointer is 4K data, because the direct pointer is smaller because the data that can be specified is small.
So the concept of indirect pointer is introduced, indirect pointer contains first-level pointer, second-level pointer, second-level pointer and third-level pointer.
If 4 bytes are divided into one unit, then the data space of the file's data space, the smallest block unit 4k, can be divided into 1024 pieces, the data space size bit 10244k=4m of the first-level pointer, and the data space size bit 4m1024=4G that can be determined by the analogy secondary pointer, and the third-level pointer specifies the data space size 4T.
Size of space occupied by 5size file data
6 the number of links several files point to the data space of this inode
In fact, a folder is also a special file, and the metadata part of the file is no different from the ordinary file.
The content stored in the data space is a file name > inode node code consists of many such pieces of data. When we delete a file, we actually delete a record from the special file content of the folder in which we are located.
Delete, at this time, because the file name and linode do not exist in the folder content space, the qu system believes that there is no name and only inode data is available space, but at this time the data still exists.
If it is a hard link, it means that one file in the same partition points to another file sharing data space.
There are two pieces of data sqiud 1001 in the contents list of the folder where they are located
Squid-link 1001
Even if any of the data is deleted, the other file can be accessed, because the other file name points to the inode node to find the node inode data in the metadata list.
Hard link intelligence is that files do not support folders. When the number of link of an inode is 0, the file is deleted.
If a file makes 1 hard link, then the number of links is 2.
The number of links to a directory is at least 2
A soft link is a file that points to another file, but a broken partition, because the inode numbers of different partitions are not common, which means that the contents of the two files are stored in relative paths.
Soft links find the data of different partitions through relative paths.
If you delete the original file, the original file soft link will not find the resource file because the soft link data space is the relative path of the record and does not write the inode number pointed to, so it will not increase the number of links (links) of the source file.
On the contrary, hard links with different names point to the same inode in the same partition, and the number of links is 2
Create a file
Touch
-a modify the read time of the file [root@localhost / home/wang] # stat F1
File:'F1'
Size: 6 Blocks: 8 IO Block: 4096 regular file
Device: 806h/2054d Inode: 114 Links: 1
Access: (0644) Uid: (0 / root) Gid: (0 / root)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-12-16 1314 25purl 30.766286983 + 0800
Modify: 2018-12-16 1314 25purl 30.766286983 + 0800
Change: 2018-12-16 1314 25purl 31.118287001 + 0800
Did not modify the previous one.
Now change the reading time to 2025-12-11 08:30:30
Touch-a-t 201812110830.30 F1
View file time
Stat f1
File:'F1'
Size: 6 Blocks: 8 IO Block: 4096 regular file
Device: 806h/2054d Inode: 114 Links: 1
Access: (0644) Uid: (0 / root) Gid: (0 / root)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-12-11 0830 30.000000000 + 0800
Modify: 2018-12-16 1314 25purl 30.766286983 + 0800
Change: 2018-16 1315 2915 58.326300564 + 0800
Birth:-
The reading time has been modified to the required time.
-m to determine the time for the file to change the data content
-t format is [[CC] YY] MMDDhhmm [.ss]
If you want to cc, then yy must write it.
Cp source destination
Cp source... Catalogue
1 when the source is the file target, the name content of the creation setting does not exist in the file
2 when the source is the file target exists for F1 file content overwrite name remains unchanged
3 when the source is the file F1 is the destination is the dir directory, create an F1 file with the same name under the dir directory file
4 creation cannot be completed when the source is multiple file targets
5 when the source is multiple file targets, one file cannot be copied.
6 when the source is a multi-file destination, the directory places the files under the target directory, the file directory, and the source directory.
7 when the source is multiple directory targets do not exist to create non-existent
8 the file cannot be copied when the source is a directory destination
9 when the source is multiple directories, the destination is one directory. Put the source directory and destination directory below.
10 when the source is a multiple directory destination does not exist to create a target directory to copy multiple directories to this directory
11 when the source is a directory target that does not exist, it is tantamount to copying the contents and changing the name of the directory.
Cp
-t switch the position of the source and target
-v see the process of replication
-- preserv
Ownership owner Information
Mode copy permission information
Context copy content information
Time information of timestamp copy file read time modify time state change time
All replicates all
-R Recursive copy deep into the folder
-d copy link name
Single quotation marks do not recognize variables or commands
"" double quotation marks recognize variables do not recognize commands
`Anti-single quotes recognize commands and variables set an alias for rm first see a random time folder mkdir-p / date/date +% s under the / date directory here use anti-single quotation marks mv-t / date/date +% s to move files to a randomly generated directory this command has not yet decided which file to delete because the latter file is followed by adding alias rm= "mkdir-p / date/date +% s" Mv-t / date/date +% s` "
Shortcut keys are generated.
If you want to remove the shortcut key unalias rm
This shortcut key is valid for a long time. Append sourcce ~ .bashr to ~ / bashr and call it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.