不记得具体是运行了 chmod 的什么权限设置,ls 之后发现文件名变成 绿色 了,网上搜了下,绿色表示可执行权限,但是我切换了其他用户,没有该文件可执行权限,ls 下文件名还是绿色,所以不是很明白。
另外如何恢复为如下图原来的灰色呢?
谢谢。
天蓬老师2017-04-17 16:35:49
Green generally indicates an executable file because you added the executex
bit to the file's mode. You cannot see the execution bit under other users because the execution x
bit is also user-specific. In Unix, file user ownership is divided into user (U), group (G), and other (O). Each user can set read, write, execution and other modes respectively. If other users cannot see the executable, it means that there is no execution x
bit under the other user. 执行x
位。在其他用户下看不到执行位,是因为执行x
位也是分用户的。在Unix中,文件用户所属分为user(U)、group(G)、other(O),每个用户所属下又可以分别设置读、写、执行等模式。出现其他用户看不到可执行,说明在other用户所属下没有执行x
位。
通过-x
可以去掉执行位,还可以更细分的操作u-x
g-x
o-x
chmod -x index.php
1楼通过设置10进制的数字也可以的。反过来,增加x
可以+x
u+x
g+x
o+x
-x
, and you can also perform more detailed operations u-x
g-x
o-x
rrreee
On the first floor, you can also set decimal numbers. Conversely, increasingx
can +x
u+x
g+x
o+x code>. 🎜
🎜This area is still very basic, it is recommended to learn it systematically. 🎜reply0
PHP中文网2017-04-17 16:35:49
Green means the file has execution permission. If chmod -x filename removes the execution permission, it will no longer be green.
Removing the --color=auto after ls in alias will also work
You can also use the ls command like below
\ls