chmod 而不修改其他使用者權限

chmod 而不修改其他使用者權限

我想 chmod 一個文件,但我想這樣做,這樣它就不會影響其他“用戶”/“群組”

例如給出根 0

before 741
chmod 0** [filename]
after 041

或給該組7分

before 741
chmod *7* [filename]
after 771

無論如何要這樣做嗎?

答案1

您可以使用符號表示,其中有+-

chmod u-rwx         # remove rwx permissions from user

或者

chmod g+rwx         # add rwx permissions to group

相關內容