Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of chattr Command under Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the usage of chattr command under Linux". In daily operation, I believe many people have doubts about the usage of chattr command under Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the usage of chattr command under Linux". Next, please follow the editor to study!

Chattr [+-=] [ASacdistu] file or file name

Command options:

+: add a special parameter, but the other existing parameters remain unchanged.

-: delete a special parameter and leave the other existing parameters unchanged.

=: set a certain setting, and only have the following parameters

A: when the A property is set, the access time atime (access) of this file (or directory) cannot be modified to avoid, for example, laptops with disk I / O errors.

S: this feature is a bit similar to sync. Is to write data synchronously to disk. Data loss can be effectively avoided.

A: after setting a, this file can only add data, not delete it. Only root can set this property.

C: after this property is set, the file will be "compressed" automatically and decompressed automatically when it is read, but when stored, it will be compressed first and then saved (useful for large files).

D: when executing the dump (backup) program, setting the d property will make the file (or directory) have the function of dumping.

I: I is very useful. It allows a file "not to be deleted, renamed, connected, written or added". It is very helpful to the security of the system.

J: when using the ext3 file system format, setting the j property will cause the file to be recorded in journal when it is written. However, when the file system setting parameter is data=journalled, this property has no effect because the log has already been set.

S: when the file is set to the s parameter, it will be completely deleted from this hard disk space.

U: in contrast to s, when u is used to set the file, the data contents are actually stored on disk and can be used to restore the deletion.

Note: on this property setting, it is more common to set an and I values, and many setting values must be set by root.

At this point, the study of "the usage of the chattr command under Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report