Manjaro does not have .profile by default?

I am new to linux, have been using only for a month now. I just installed Manjaro 21.3.7 version with KDE. I need to add the Golang compiler to the PATH, which I normally do (in previous distro, Linux Mint) by adding export PATH=$PATH:/usr/local/go/bin to the ~/.profile file. I can’t seem to find this file in Manjaro. Will it work if I add this file manually? I temporarily fixed this by adding the same line to ~/.zshrc file. In the process, another question came to my mind. If Manjaro uses zsh as default, why does echo $SHELL return /bin/bash??? I initially entered this command to check which shell Manjaro uses (returned /bin/bash) and added the PATH line to ~/.bashrc which did not work. Adding it to ~/.zshrc worked, which means Manjaro is actually using zsh.

Yes, you can create it manually.

~/.profile does not exist by default, and creating it will not necessarily result in the file being sourced.

Adding it to ~/.zshrc would work, but better would be ~/.zprofile, if it exists. The logic is that the *rc file is read at every invocation of an interactive shell, while the *profile file is only read at login time.

It might also be a good idea to add it to ~/.bash_profile as well, for reasons explained below.

The system shell is still bash, and that is the shell you’ll get in a tty session, but the graphical terminal window profiles have been set up to use zsh instead. Not everyone is happy about that, but the majority of our users requested it.


Okay that explains everything. ~/.zprofile does not exist either but ~/.bash_profile does. I prefer adding PATHs to ~/.*profile for the same reason, everything is configured at login time. I just removed the PATH from ~/.zshrc and added it to ~/.bash_profile and logged in again. It works. Thank you.


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.