In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Role identification of documents on the Linux, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
Some files on Linux systems may appear in multiple locations. Follow the instructions in this article to find and identify these "identical twins" and see why hard links are so beneficial.
Identifying files that use the same disk space depends on the fact that files use the same inode. This data structure stores all information except the file name and content. If two or more files have different names and file system locations, but share an inode, they also share content, ownership, permissions, and so on.
These files are often referred to as "hard links", unlike symbolic links (that is, soft links) that point to other files simply by containing their names. Symbolic links are easily identified in the file list by the l in * locations and the-> symbol of the referenced file.
$ls-l my*-rw-r--r-- 4 shs shs 228 Apr 12 19:37 myfilelrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref-> myfile-rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin
The hard link in a single directory is not obvious, but it is still very easy to find. If you use the ls-I command to list files and sort them by inode number, you can easily pick out hard links. In this type of ls output, the * * column shows the inode number.
$ls-I | sort-n | more... 788000 myfile / dev/null 788000 4-rw-r--r-- 4 shs shs 228 Apr 12 19:37 / tmp/mycopy 788000 4-rw-r--r-- 4 shs shs 228 Apr 12 19:37 / home/shs/myfile 788000 4-rw-r--r-- 4 shs shs 228 Apr 12 19:37 / home/shs/save/mycopy 788000 4-rw-r--r -- 4 shs shs 228 Apr 12 19:37 / home/shs/mytwin
Notice that the error output is redirected to / dev/null so that we don't have to look at all "Permission denied" errors, otherwise they will be displayed in other directories that we are not allowed to view.
In addition, scanning files that contain the same content but do not share inode (that is, simple text copies) will take more time and effort.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.