How to start a shell without any user configuration?

后端 未结 3 576
有刺的猬
有刺的猬 2020-12-12 15:54

I need to use a \"clean\" shell (e.g. bash) under Linux/OSX terminal without any user configuration, but it reads config info from some files (e.g ~/.bashrc) every time it s

3条回答
  •  情书的邮戳
    2020-12-12 16:43

    Use --noprofile --norc:

       --noprofile
              Do  not  read either the system-wide startup file /etc/profile or any of the personal initializa‐
              tion files ~/.bash_profile, ~/.bash_login, or ~/.profile.  By default,  bash  reads  these  files
              when it is invoked as a login shell (see INVOCATION below).
    
       --norc Do  not  read  and  execute the system wide initialization file /etc/bash.bashrc and the personal
              initialization file ~/.bashrc if the shell is interactive.  This option is on by default  if  the
              shell is invoked as sh.
    

    (from the manpage).

提交回复
热议问题