linux設定umask值, 建立的預設檔案和目錄的許可權
LINUX中 設定了umask 建立的預設檔案和目錄的許可權
普通檔案預設是644
自已有讀寫(rw),同組人員有讀(r),其它有讀(r)
預設許可權可通過umask 修改
預設umask 為022
檔案:666 - 022 = 644
目錄:777 - 022 = 755
如果你下了umask 011 的指令,則生成的檔案目錄許可權就變成:
檔案:666 - 011 = 655
目錄:777 - 011 = 766
修改 .bash_profile 檔案就可以了
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
alias ls='ls -CF'
PS1='SZDATA_suheadof:$PWD> '; export PS1
umask 022 #########就是這個問題
set -o vi
stty intr '^c'
stty -istrip
TERM=vt220; export TERM
EDITOR=vi; export EDITOR
TEMP=/tmp; export TEMP
TMPDIR=/tmp; export TMPDIR
### SETUP ORACLE ENVIRONMENT ###
ORACLE_SID=ora10; export ORACLE_SID
ORACLE_BASE=/home/oracle; export ORACLE_BASE
ORACLE_HOME=/home/oracle/product/10.2.0; export ORACLE_HOME
ORACLE_TERM=ansi; export ORACLE_TERM
JAVA_FONTS=/usr/share/fonts/zh_CN/TrueType/; export JAVA_FONTS
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK; export NLS_LANG
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
##CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$HOME/tomcat5/common/lib/classes12.jar:$HOME/bea/weblogic81/common/lib/classes12.jar
##CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
##export CLASSPATH
PATH=.:/usr/local/ant/bin:$ORACLE_HOME/bin:$PATH
export PATH
### FOR ORACLE INSTALL ###
#export LC_ALL="en_US"
#export LC="en_US"
### FOR JAVA ###
#JAVA_HOME=/usr/local/jdk1.5.0; export JAVA_HOME
#JAVA_HOME=/usr/local/j2sdk1.4.2_04; export JAVA_HOME
#PATH=$JAVA_HOME/bin:$PATH
#CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:/usr/local/tomcat5/common/lib/classes12.jar:/usr/local/tomcat5/common/lib/jsp-api.jar:/usr/local/tomcat5/common/lib/servlet-api.jar export CLASSPATH
### TOMCAT ###
#CATALINA_HOME=/home2/headof/maintain/apache-tomcat-6.0.2; export CATALINA_HOME
#CATALINA_HOME=/usr/local/tomcat5; export CATALINA_HOME
#JBOSS_HOME=/usr/local/jboss; export JBOSS_HOME
MS_SHELL=/home/nr/shell; export MS_SHELL
#ANT_HOME=/usr/local/apache-ant-1.7.0; export ANT_HOME
#PATH=$PATH:$ANT_HOME/bin; export PATH
# Developers variables:
SU_DIR=/home2/headof/maintain; export SU_DIR
PATH=$PATH:$SU_DIR; export PATH
MS_SHELL=/home/nr/shell; export MS_SHELL
MS_SEND=/tmp; export MS_SEND
MS_SEMA=/tmp/sema.basis; export MS_SEMA
MS_NIGHTRUN=/tmp/nr.ho.basis; export MS_NIGHTRUN
MS_LIST=/home2/headof; export MS_LIST
MS_COMM=/home2/headof;