Linux系统中的chattr命令常用办法
<h1 style="color: black; text-align: left; margin-bottom: 10px;">CentOS7.3学习笔记总结(四十四)-Linux系统中的chattr命令常用<span style="color: black;">办法</span></h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Chattr(change file attributes on a Linux file system)命令<span style="color: black;">能够</span>更改Linux文件系统上的文件属性。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">chattr命令必须root权限,普通用户不授权是<span style="color: black;">没法</span><span style="color: black;">运用</span>此命令的。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">lsattr查看文件权限。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/cae8b7f22b954836bf75af2af7fb4899~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1724861045&x-signature=Cg6bF%2F56ha95%2FzeGfUnSiQ9AagA%3D" style="width: 50%; margin-bottom: 20px;"></div>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/12104c42be914defab9315cefe71c5c1~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1724861045&x-signature=cu3qtCXYPHqlwi5GVn%2BX%2B2t7eYk%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">语法:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/7752f79cc5ab424584ebbe01fc5ea282~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1724861045&x-signature=6UZTIDXrxUwS95qLr8riLU3VZH0%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">模式:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">+:在原有参数设定<span style="color: black;">基本</span>上,追加参数。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">-:在原有参数设定<span style="color: black;">基本</span>上,移除参数。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/a16f1a98b39a4acd8cd585941b3330af~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1724861045&x-signature=UXabH8mNBqnocqfQ5pHd7GBrjBo%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">=:更新为指定参数设定。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">i:锁定<span style="color: black;">或</span>解除文件的锁定属性(删不掉,改不了)</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/7763718bec8342d5a2eb09aeb09d4a73~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1724861045&x-signature=Hfv1qBdGSTtzk%2FdpKayuYKhAHas%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">a:让文件或目录仅供附加用途;</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p26-sign.toutiaoimg.com/pgc-image/bad2c7ce82f64fdaafa5a5bc3a3b29ff~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1724861045&x-signature=YMl5MZoybr7uIMx8xYBYWdpnSEU%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">c:将文件或目录压缩后存放;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">d:将文件或目录排除在倾倒操作之外;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">s:保密性删除文件或目录,<span style="color: black;">倘若</span>删除该文件,则<span style="color: black;">没法</span>找回;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">S:即时更新文件或目录;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">u:预防意外删除,与s相反。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">选项:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">-R:递归处理,将指令目录下的所有文件及子目录一并处理;</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/1ed1ab195a744c8ea61ea0e165f8d89a~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1724861045&x-signature=lTiaWzI2JQFamdx8IP9bIqaJ0kY%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">-v<版本编号>:设置文件或目录版本;</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">-V:<span style="color: black;">表示</span>指令执行过程;</p>
外链发布社区 http://www.fok120.com/ 我完全赞同你的观点,思考很有深度。 这篇文章真的让我受益匪浅,外链发布感谢分享!
页:
[1]