诺甘农圆盘

参考资料收集库

用户工具

站点工具


linux:umask

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
linux:umask [2022/04/13 11:04] packingboxlinux:umask [2022/04/13 11:07] (当前版本) packingbox
行 7: 行 7:
 %%To dispay the current value of **umask**, run the //umask// command without any options:%% %%To dispay the current value of **umask**, run the //umask// command without any options:%%
  
-{{https://geek-university.com/wp-content/images/linux/umask_command.jpg|linux umask command}}+{{:linux:pasted:20220413-110428.png}}
  
 %%Ignore the first zero for now. The last three numbers represent the default **umask value**.%% %%Ignore the first zero for now. The last three numbers represent the default **umask value**.%%
行 13: 行 13:
 %%To temporarily change your **umask** value, run the// umask// //VALUE// command. This changes the umask value only for the current shell:%% %%To temporarily change your **umask** value, run the// umask// //VALUE// command. This changes the umask value only for the current shell:%%
  
-{{https://geek-university.com/wp-content/images/linux/change_umask.jpg|linux change umask}}+{{:linux:pasted:20220413-110421.png}}
  
 %%In the picture above you can see that we have changed the **umask** value to** 044**. Remember the numbers representing the permissions: **r**=**4**, **w**=**2** and **x**=**1**. The umask of **044** means that the permissions for the newly created files will be **rw- -w- -w-** or** 622** (because **044** subtracted from **666** gives** 622**). The permissions for the newly created directories will be **rwx -wx -wx** or** 733** (because **044** subtracted from **777** gives **733**).%% %%In the picture above you can see that we have changed the **umask** value to** 044**. Remember the numbers representing the permissions: **r**=**4**, **w**=**2** and **x**=**1**. The umask of **044** means that the permissions for the newly created files will be **rw- -w- -w-** or** 622** (because **044** subtracted from **666** gives** 622**). The permissions for the newly created directories will be **rwx -wx -wx** or** 733** (because **044** subtracted from **777** gives **733**).%%
行 21: 行 21:
 %%To change the default umask value permanently for a specific user, you need to modify the **.bashrc** file in the user’s home directory. For example, to change the default umask for user** bob**, just add the following line at the end of the **/home/bob/.bashrc** file:%% %%To change the default umask value permanently for a specific user, you need to modify the **.bashrc** file in the user’s home directory. For example, to change the default umask for user** bob**, just add the following line at the end of the **/home/bob/.bashrc** file:%%
  
-{{https://geek-university.com/wp-content/images/linux/change_umask_user.jpg|linux change umask user}}+{{:linux:pasted:20220413-110413.png}}
  
 %%Reopen the shell. The default umask value is now **044**:%% %%Reopen the shell. The default umask value is now **044**:%%
  
-{{https://geek-university.com/wp-content/images/linux/new_default_umask_value.jpg|linux new default umask value}}+{{:linux:pasted:20220413-110401.png}}
  
 %%To change the default umask value permanently for all users, you can use the following command:%% %%To change the default umask value permanently for all users, you can use the following command:%%
行 31: 行 31:
 //%%pam-config -a –umask –umask-umask=VALUE%%// //%%pam-config -a –umask –umask-umask=VALUE%%//
  
-{{https://geek-university.com/wp-content/images/linux/pam_config_change_umask.jpg|linux pam-config change umask}}+{{:linux:pasted:20220413-110354.png}}
  
 %%Replace the last three numbers with the umask of your choice. The change will be made the next time you log in to the system. Note that the umask definition in the **.bashrc** file will override the system umask.%% %%Replace the last three numbers with the umask of your choice. The change will be made the next time you log in to the system. Note that the umask definition in the **.bashrc** file will override the system umask.%%
linux/umask.txt · 最后更改: 2022/04/13 11:07 由 packingbox