chmod函式的使用

2021-06-26 12:38:22 字數 588 閱讀 6500

chmod函式改變目錄或者檔案的許可權

1、s_isuid 04000 檔案的 (set user-id on execution)位

2、s_isgid 02000 檔案的 (set group-id on execution)位

3、s_isvtx 01000 檔案的sticky 位

4、s_irusr (s_iread) 00400 檔案所有者具可讀取許可權

5、s_iwusr (s_iwrite)00200 檔案所有者具可寫入許可權

6、s_ixusr (s_iexec) 00100 檔案所有者具可執行許可權

7、s_irgrp 00040 使用者組具可讀取許可權

8、s_iwgrp 00020 使用者組具可寫入許可權

9、s_ixgrp 00010 使用者組具可執行許可權

10、s_iroth 00004 其他使用者具可讀取許可權

11、s_iwoth 00002 其他使用者具可寫入許可權

12、s_ixoth 00001 其他使用者具可執行許可權

#include #include #include void main()

chmod命令的使用

指令名稱 chmod 使用許可權 所有使用者 使用方式 chmod cfvr help version mode file.說明 linux unix 的檔案呼叫許可權分為 檔案擁有者 群組 其他。利用 chmod 可以藉以控制檔案如何被他人所呼叫。引數 mode 許可權設定字串,格式如下 ugoa...

chmod命令的使用

chmod命令 修改檔案 目錄許可權 對於檔案或者目錄的普通許可權,共有 3 種,分別為 r 讀取 4 w 寫入 2 x 執行 1 一般格式為 chomd 777 filename rw 600 只有屬主有讀寫許可權。rw r r 644 只有屬主有讀寫許可權 而屬組使用者和其他使用者只有讀許可權。...

chmod使用範例

chmod 750 a.out 改變 a.out的許可權為750 chmod a x a.out 對所有使用者增加 a.out的執行許可權,a all 表示所有使用者 chmod u rwx a.out 設定屬主的許可權為讀 寫和執行,u user 表示屬主使用者 chmod g rw a.out ...