In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what to do if linux can't delete files". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
First use lsattr to see what properties the file has, and then use chattr
1. Action
Modify the ext2 and ext3 file system properties (attribute) to use the privileged superuser.
two。 Format
Chattr [- RV] [- + = AacDdijsSu] [- v version] file or directory
3. Main parameters
-R: recursively processes all files and subdirectories.
-V: display the changes in detail and print out.
-: invalidation attribute.
+: activate the attribute.
=: specify the attribute.
A:Atime, tell the system not to change the last access time to this file.
S:Sync, once the application performs a write operation on this file, causes the system to write the modified results to disk immediately.
A:Append Only, the system only allows data to be appended to this file, and no process is allowed to overwrite or truncate the file. If the directory has this property, the system will only allow files to be created and modified in this directory, not to delete any files.
I:Immutable, the system does not allow any changes to this file. If the directory has this attribute, then any process can only modify the files under the directory and is not allowed to create and delete files.
D: check for errors in the compressed file.
D:No dump, the dump program will ignore this file when backing up the file system.
C:Compress, the system compresses this file transparently. When reading from this file, the unzipped data is returned; when writing data to this file, the data is first compressed before it is written to disk.
: Secure Delete, let the system populate the area where the file is located with 0 when deleting the file.
U:Undelete, when an application requests to delete the file, the system retains its data blocks so that the file can be deleted later.
4. Description
The chattr command is very useful, some of which are supported by the Linux kernel version, and if the Linux kernel version is less than 2.2, then many functions cannot be implemented. The same-D function to check for errors in compressed files requires more than 2.5.19 kernels to support. In addition, modifying properties through the chattr command can improve the security of the system, but it is not suitable for all directories. The chattr command cannot protect the /, / dev, / tmp, / var directories.
This is the end of the content of "what to do if linux can't delete the file". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.