Question

I have the following lines in my .zshrc

source /etc/profile    
source $HOME/.profile

My .profile is not loaded without them, although .profile should be loaded by default in Unix systems.

How can you load .profile without sourcing it at .zshrc?

Was it helpful?

Solution

Look in the Zsh manual where it says to use ~/.zprofile instead of ~/.profile.

OTHER TIPS

In addition to what Martin says about zprofile vs profile, also note that /etc/zprofile and ~/.zprofile are only read when zsh is started as a login shell. If it is "just" an interactive shell, it will only read .zshrc. So the question is how you are starting the zsh. If you use something like Gnome Terminal, you can set in the Profile Preferences that the shell should be started as a login shell.

More info: Z-Shell User's Guide

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top