Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When starting my shell with e.g. exec zsh from the command line, how can I have it not parse any /etc/ files?

I read in the zsh guide that when a user starts a zsh shell, it processes the following init files in order:

# Every shell. Always

# Every shell. Avoidable if passing flag -f to zsh

# If it's a login shell.

# If it is an interactive shell

# If it is a login shell

When starting zsh, I would like to skip processing all the /etc/* files (except /etc/zshenv which I assume I can't skip as a non-root user?), and only parse my own init files in my home directory.

How can I do this when I invoke exec zsh from the command line?

share|improve this question
up vote 4 down vote accepted

Unset the GLOBAL_RCS option. To do this, add unsetopt GLOBAL_RCS to /etc/zshenv or $ZDOTDIR/.zshenv or run zsh -o NO_GLOBAL_RCS. Note that if $ZDOTDIR is unset, $HOME is used instead.

When GLOBAL_RCS is unset, /etc/zprofile, /etc/zshrc, /etc/zlogin and /etc/zlogout will not be sourced.

share|improve this answer
Thanks. I do not have admin rights to edit /etc/zshenv. I guess I can add this to ~/zshenv instead? – Amelio Vazquez-Reina Apr 15 '13 at 23:24
That will work. You personal zshenv file is sourced right after /etc/zshenv, before the other config files are sourced. I have edited my answer to include that. – Evan Teitelman Apr 15 '13 at 23:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.