·

Linux文件权限01

Published at 2024-08-27 20:37:11Viewed 88 times
Professional article
Please reprint with source link

设置文件属性与权限
三个常用的修改权限命令:chown修改文件属主,属组
chgrp修改文件属组
chmod修改文件权限

例 使用chown命令修改文件的属主 从root改为Ybaci

修改属主的同时修改属组,在属主与属组之间加入“.”即可

只需要更改文件的属组而不需要更改属主,使用chgrp命令

修改文件权限使用chmod命令
给该属组增加执行权限,当查看属组权限字符位出现“x”,说明增加执行权成功 chmod u+x

给该属组增加写入权限,当查看属组权限字符位出现“w”,说明增加执行权成功 chmod g+w

同时给所有对象增加读,写,执行权限,在chmod命令后加“a”符号,然后覆盖当前全部权限
chmod a=rwx file

同时给所有对象删除某一个权限 chmod a-x
同时删除所有对象的全部权限 chmod a=- file

chown:将某个资源的访问权限给予别人
chmod:改变某个文件的访问模式与命令

0 人喜欢

Comments

There is no comment, let's add the first one.

弦圈热门内容

[antd: Message] You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.

I'm getting this error when using MessageWarning: [antd: Message] You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.Here is my code:import { message } from 'antd'; export default function Page() { const [messageApi, contextHolder] = message.useMessage(); const res = await fetch("/api/...", { method: "POST", }); if (!res.ok) { messageApi.error("Error! Fail to login!"); } return ( <Home> ... </Home> ) }

Get connected with us on social networks! Twitter

©2024 Guangzhou Sinephony Technology Co., Ltd All Rights Reserved