Ask Different (Apple)
Q&A for power users of Apple hardware and software
Latest Questions
44
votes
8
answers
87742
views
How to set system-wide environment variables
We used to use `/etc/environment` to set system-wide environment variables on Mountain Lion. However, it seems this file is no longer read. Ideally the solution should apply to all users, and we need it to work with ssh console sessions. So we need this to work ssh user@mavericks-machine 'echo $MY_E...
We used to use
/etc/environment
to set system-wide environment variables on Mountain Lion. However, it seems this file is no longer read.
Ideally the solution should apply to all users, and we need it to work with ssh console sessions. So we need this to work
ssh user@mavericks-machine 'echo $MY_ENV_VAR'
So far we've tried:
- /etc/launchd.conf
Works for all users, but only applies to 'windowed' applications, i.e. works in Terminal, but not in an ssh session.
- ~/.profile
, ~/.bash_profile
etc.
Only applies to shells
Any suggestions?
joerick
(828 rep)
Oct 31, 2013, 02:41 PM
• Last activity: May 2, 2025, 10:04 AM
2
votes
2
answers
11399
views
Shell set environment variables for command
I want to run a program in Terminal and set its environment variables. According to my research one can do this using: VARIABLE="value" VARIABLE2="value2" run_program Now I'd like to set a variety of variables using a configuration file. Indeed, I could inject variables into the active shell using:...
I want to run a program in Terminal and set its environment variables. According to my research one can do this using:
VARIABLE="value" VARIABLE2="value2" run_program
Now I'd like to set a variety of variables using a configuration file. Indeed, I could inject variables into the active shell using:
. program_variables.config
I then can use
echo $VARIABLE
in the terminal.
Anyway, when I now run
. program_variables.config run_program
I cannot access the variables within the program. I also tried separating the two parts with ;
and &&
.
After thinking about what's happening there I had the following ideas:
cat program_variables.config | xargs run_program
cat program_variables.config | tr -d '\n' run_program
and a few more.
I didn't write the called program myself so I cannot change the behavior how variables are read.
Any ideas how I output the file as if I would have written its content in the shell myself?
Julian F. Weinert
(160 rep)
Apr 2, 2015, 11:16 PM
• Last activity: Feb 15, 2025, 08:35 PM
2
votes
1
answers
71
views
sudo -E -s does not preserve ZDOTDIR
Running `zsh` on macOS Ventura → With `sudo --preserve-env -s` the environment variable `ZDOTDIR` is not preserved but all the others are. → With `sudo --preserve-env=ZDOTDIR -s` the variable `ZDOTDIR` is preserved but not the other variables. Why is `ZDOTDIR` not preserved in the first case ?
Running
zsh
on macOS Ventura
→ With
sudo --preserve-env -s
the environment variable ZDOTDIR
is not preserved but all the others are.
→ With sudo --preserve-env=ZDOTDIR -s
the variable ZDOTDIR
is preserved but not the other variables.
Why is ZDOTDIR
not preserved in the first case ?
Damien L
(259 rep)
Nov 15, 2022, 08:37 PM
• Last activity: Jul 16, 2024, 08:59 AM
5
votes
1
answers
12762
views
Defining environment variables with launchd/launchctl
There are different solutions regarding the definition of environment variables that are stored in the `launchd` process, namely over at [StackOverflow](https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x) and [Superuser](https://superuser.com/questions/476752/setting-en...
There are different solutions regarding the definition of environment variables that are stored in the
launchd
process, namely over at [StackOverflow](https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x) and [Superuser](https://superuser.com/questions/476752/setting-environment-variables-in-os-x-for-gui-applications) . How do these solutions differ?
Percival Ulysses
(848 rep)
Sep 22, 2012, 12:02 PM
• Last activity: Jul 13, 2024, 02:18 PM
3
votes
3
answers
1598
views
Automator run shell script does not know my PATH?
When I use the "run shell script" in automator, and do, for example ``` say $PATH ``` it then tells me the PATH. But the path is incomplete. Some items I have in $PATH when using the terminal (zsh) are missing. How can I fix this, so I have the same $PATH variable everywhere?
When I use the "run shell script" in automator, and do, for example
say $PATH
it then tells me the PATH. But the path is incomplete. Some items I have in $PATH when using the terminal (zsh) are missing.
How can I fix this, so I have the same $PATH variable everywhere?
Ma Joad
(461 rep)
Feb 21, 2023, 10:31 AM
• Last activity: Jan 10, 2024, 06:42 AM
3
votes
1
answers
550
views
MACHTYPE environment variable on ARM
I am on an M3 Pro, MacOS 14.2. When I try `echo $MACHTYPE` (in a default `-zsh` shell) the output is `x86_64`, whereas [uname][1] `-mp` returns `arm64 arm`. [Zsh docs][2] say that `MACHTYPE` should be "the machine type (microprocessor class or machine model), as determined at compile time." Why is m...
I am on an M3 Pro, MacOS 14.2. When I try
echo $MACHTYPE
(in a default -zsh
shell) the output is x86_64
, whereas uname -mp
returns arm64 arm
. Zsh docs say that MACHTYPE
should be "the machine type (microprocessor class or machine model), as determined at compile time." Why is my compile time machine type set to x86_64
? I am not running Terminal with Rosetta. Perhaps a more robust question, what is the intended usage of the MACHTYPE
shell parameter on ARM-based MacOS?
shea
(315 rep)
Dec 29, 2023, 11:49 PM
• Last activity: Dec 31, 2023, 09:13 AM
2
votes
4
answers
495
views
Automate workspace setup
I'm a software developer and I often have to switch between different projects, each with its own environment setup. Some actions I have to do each time include: - creating ssh tunnels - connecting database inspectors - applying git stashes with local dev connection strings - starting local servers...
I'm a software developer and I often have to switch between different projects, each with its own environment setup. Some actions I have to do each time include:
- creating ssh tunnels
- connecting database inspectors
- applying git stashes with local dev connection strings
- starting local servers
- opening specific IDE on the right project
- recovering Postman saved requests for the specific project
- set env variables
- ...
Those are all very basic tasks, but I have to do them every time with great time waste and chances to mess up.
It would be really cool to have something like:
- an "application" or "desktop icon" named after the project
- click on it and it will open a dedicated workspace with everything ready to start developing
- keep the local environment isolated
Is there something like this I can setup on my Mac?
Thanks
Carlo Moretti
(123 rep)
Nov 13, 2020, 10:03 AM
• Last activity: Dec 16, 2023, 11:48 AM
0
votes
0
answers
86
views
TMPDIR is not set in a new shell when using su
On a Mac running macOS 13.5, `$TMPDIR` is not set in a new shell. This is a multi-user machine, and it is unset for all users that are `su`ed to, causing multiple issues since libraries may default to `/tmp`, which is not writable by everyone. The Mac with the problem is accessed via SSH through one...
On a Mac running macOS 13.5,
$TMPDIR
is not set in a new shell. This is a multi-user machine, and it is unset for all users that are su
ed to, causing multiple issues since libraries may default to /tmp
, which is not writable by everyone.
The Mac with the problem is accessed via SSH through one account, and when I change to another account using:
sudo su - otheruser
I get an environment without TMPDIR
. Now, I understand that sudo su
discards environment variables; this is fine! I don't want the sudo
ing user's temporary directory, but the one of the user being accessed.
How can I accomplish that?
Note that it works when I SSH into the target user directly.
slhck
(2274 rep)
Nov 16, 2023, 07:11 PM
173
votes
12
answers
876879
views
How do I set environment variables on OS X?
I have always difficulties setting the Environment variables in OS X like `JAVA_HOME`, `M2_HOME` or `PATH`. How to set these on OS X Mavericks? I did some research but the answers I've found didn't really help me yet: 1. `export JAVA_HOME=/...` (But it seems that the changes are temporary, just for...
I have always difficulties setting the Environment variables in OS X like
JAVA_HOME
, M2_HOME
or PATH
. How to set these on OS X Mavericks?
I did some research but the answers I've found didn't really help me yet:
1. export JAVA_HOME=/...
(But it seems that the changes are temporary, just for one terminal session.)
2. setenv JAVA_HOME=/...
(But command not found.)
3. Open .profile
and write the variables inside to make the changes permanent- (.profile
does not exist).
4. Open .bash_profile
and write the variables inside to make the changes permanent- (.bash_profile
does not exist).
5. vi ~/.bash_profile
(Quite a challenge for somebody who doesn't know vi
.)
6. Creating your own enrivonment.plist
file.
Can somebody please walk me through the steps to get that to work on OS X Mavericks, assuming *no* Unix knowhow?
akcasoy
(1959 rep)
Oct 25, 2013, 01:13 PM
• Last activity: Oct 12, 2023, 02:11 PM
7
votes
0
answers
2504
views
How to set PATH for all applications on a per-user basis?
I'm looking for a way to set the `PATH` environment variable for **all** applications that **I** (and only I) run under macOS (version 14 / Sonoma at the time of writing.) That sounds like it *ought* to be straightforward, but it seems not to be, and I haven't found any current, working instructions...
I'm looking for a way to set the
PATH
environment variable for **all** applications that **I** (and only I) run under macOS (version 14 / Sonoma at the time of writing.) That sounds like it *ought* to be straightforward, but it seems not to be, and I haven't found any current, working instructions on how to do it.
To be clear, here are three things that I **do** know how to do, that there are (some) decent instructions out there for, and that are **not** what I'm asking about now:
1. Set the environment variables for a shell (e.g. zsh, bash, etc) and by extension applications that are launched *from* that shell. All the normal UNIX techniques and configuration files work fine for this. If I set a variable in my ~/.zshrc
and then start any app I want (GUI or not) from within zsh, it works as expected.
2. Set an environment variable which is **not** PATH
for apps *not* launched from a shell. There are several ways of doing that using launchctl setenv
, and they're dirty and hackish, but they work. I've written up one way of doing that at Add system-wide environment-variables in MacOS Ventura . However, macOS appears to have special-case handling for PATH
that's different from other environment variables.
3. Change the PATH
variable for **all** users: I can add entries to /etc/paths
or /etc/paths.d/
but then those affect everybody, which is actively unhelpful on a multi-user system, especially since I want to include some directories that other users can't even access.
So, those out of the way, does anyone know of a command, configuration file, settings option, magic incantation, etc. that will let me set the PATH
variable given to any process I launch, no matter how I launch it (e.g as a login item, from Finder, from the dock, whatever) that doesn't involve making a system-wide change and messing up other users?
Eric Anderson
(191 rep)
Oct 6, 2023, 05:35 PM
• Last activity: Oct 6, 2023, 06:41 PM
1
votes
2
answers
4363
views
Set environment variable for the whole GUI session (Aka without using `~/.zshenv`)
(EDIT OF 06/02/2023 : Previous title was *Variables set using launchctl setenv aren't part of environment in Mac OS 12* ) I'm a daily Linux user and decided to try Mac recently. I have a Macbook pro 13" early 2015 that currently run macOS Monterey (12.6.3). I'm struggling since a few day to setup SS...
(EDIT OF 06/02/2023 : Previous title was
*Variables set using launchctl setenv aren't part of environment in Mac OS 12* )
I'm a daily Linux user and decided to try Mac recently.
I have a Macbook pro 13" early 2015 that currently run macOS Monterey (12.6.3).
I'm struggling since a few day to setup SSH_AUTH_SOCK environment variable for my whole session
I relied on the following plist file in
$HOME/Library/LaunchAgents/
:
Label
com.mooltipass.mc-agent
RunAtLoad
StandardOutPath
/tmp/mc-agent.log
StandardErrorPath
/tmp/mc-agent.err
Debug
ProgramArguments
/opt/local/bin/mc-agent
-n
--address=/tmp/moolticute-ssh-agent.sock
EnvironmentVariables
AUTH_SSH_SOCK
/tmp/moolticute-ssh-agent.sock
TOTO
test
I then activate the agent using launchctl bootstrap gui/501/com.moolticute.mc-agent
(or something similar, i don't remember well) and restart my session.
The binary mc-agent
is running as expected but:
- when i check SSH_AUTH_SOCK
variable, it still contains the default value, not the one superseeded by my script.
- when i run virt-manager
(which make use of this variable) from the Launchpad, it obviously doesn't have the correct value.
- when i run launchctl getenv SSH_AUTH_SOCK
the variable value is the one expected.
did i missed something ?
**06/02/2023 : EDIT FOR CLARIFICATIONS**
After the first answer, which is correct but doesn't fullfill my needs, i noticed that my question wasn't clear enought.
At the end, i want to mimic the behaviour of regular ssh-agent
.
On raw MacOS installation, ssh-agent
is launched using a plist
file at GUI session launch, out of any shell.
I want my agent to be launched at GUI session startup and the environment variable set for the whole session, in or out the shell.
The goal is, when i launch virt-manager
(which is a graphical app) directly from the finder or launchpad, no shell is spawned to launch it, virt-manager
won't inherit the variable set in my .zshenv
or .bashrc
, right ?
This is the same i guess for any IDE with git connectivity.
For example, in Linux, this would be achieved by tweaking Xsession
for your favourite DM or by using legacy startup mode for xsession
and setting a .xinitrd or .Xsession.
Then, every variable set this way will be inherit by any applications launched from the window manager as it's part of its environment.
I have read this week end several methods to do this with launchctl
/ launchd
but it seems that all of them stopped working on later MacOS versions...
binarym
(111 rep)
Feb 4, 2023, 04:22 PM
• Last activity: Oct 6, 2023, 05:29 PM
0
votes
1
answers
373
views
No $PATH file in my home folder on my Ventura 13.5.2?
I am using zsh and I wanted to modify the $PATH variable permanently. I can't seem to find either ```.zshrc``` or ```.zsh_profile``` on my computer -- I tried searching in Finder with enabled hidden files. I tried creating ```.zshrc``` in my home folder. Here is the full text of what I pasted there....
I am using zsh and I wanted to modify the $PATH variable permanently. I can't seem to find either
.zshrc
or .zsh_profile
on my computer -- I tried searching in Finder with enabled hidden files.
I tried creating .zshrc
in my home folder. Here is the full text of what I pasted there.
/Users/dnes/Library/Python/3.9/bin
I then made this file executable. Here is what I now see when opening Terminal:
Last login: Wed Sep 27 20:30:43 on ttys000
/Users/dnes/.zshrc:1: permission denied: /Users/dnes/Library/Python/3.9/bin
dnes@MacBook-Air-Denis ~ %
I also tried $ZDOTDIR
to see where the file is. But the command only produced a blank line. Meanwhile $PATH
produces a normal string of few paths divided by :
as one normally expects.
I know that for one Terminal session I can use $PATH
. How do I nowadays modify my $PATH variable permanently?
dnes
(99 rep)
Sep 21, 2023, 06:44 PM
• Last activity: Sep 27, 2023, 02:33 PM
2
votes
0
answers
173
views
Set Environment Variable for specific application that starts at login
I need to set an env var for an app on MacOs. This is an app that I want to run on startup (currently via Login Items). I can set the env var as a LaunchAgent plist file with the RunAtLoad key set and it will set the env var correctly but on reboot the app starts before this env var is set. If I clo...
I need to set an env var for an app on MacOs. This is an app that I want to run on startup (currently via Login Items). I can set the env var as a LaunchAgent plist file with the RunAtLoad key set and it will set the env var correctly but on reboot the app starts before this env var is set. If I close the app and restart it, it accepts the env variable.
I have also created a .zshenv file and set it there but have the same issue.
How can I set this env var to be effective for the OS or user session before the app is started via login items?
Ramias
(83 rep)
Aug 26, 2023, 10:32 PM
• Last activity: Aug 26, 2023, 11:25 PM
3
votes
2
answers
284
views
Can I use the output of a shell script to set env vars from launchd?
I'm using `launchd` to set an env var at startup using `launchctl setenv`. The script works fine when the variable is hardcoded in it, but unfortunately I need to get this variable dynamically at startup from a script. The reason I'm trying to use `launchd` for this (rather than using `.zshrc` to ru...
I'm using
launchd
to set an env var at startup using launchctl setenv
.
The script works fine when the variable is hardcoded in it, but unfortunately I need to get this variable dynamically at startup from a script.
The reason I'm trying to use launchd
for this (rather than using .zshrc
to run export MYVAR=...
) is that the script will prompt me for a password before returning the desired value, and I don't want to enter the password every single time I open a shell.
If I were using Linux, I could simply use .zprofile
for this, which is only sourced for login shells, which only happens at system login. But this is MacOS: **every** shell is a login shell, and so every shell sources .zprofile
together with the rest of files. Hence my attempt at doing this in launchd
.
So my question is:
Is there any way for launchd to "read" the output from an interactive shell script, and then use that output as input for the launchctl setenv
command?
VMX
(141 rep)
Jun 29, 2023, 05:29 PM
• Last activity: Jul 1, 2023, 10:07 AM
46
votes
8
answers
179440
views
How to add MySQL to $PATH variable to resolve "mysql: command not found"?
I installed MySQL on my Mac, and now I would like to add it to my `$PATH` variable. I want to be able to type `mysql` anywhere. I tried adding the following to my `.profile` file: export PATH=${PATH}/usr/local/mysql/bin/ I have restarted my Terminal but it does not do the trick. It still says: `-bas...
I installed MySQL on my Mac, and now I would like to add it to my
$PATH
variable. I want to be able to type mysql
anywhere.
I tried adding the following to my .profile
file:
export PATH=${PATH}/usr/local/mysql/bin/
I have restarted my Terminal but it does not do the trick. It still says: -bash: mysql: command not found
.
How can I add this properly to my $PATH
?
I am using OS X Yosemite.
JNevens
(639 rep)
Mar 15, 2015, 11:14 AM
• Last activity: Jun 27, 2023, 05:04 PM
0
votes
1
answers
2618
views
How to unset a variable which is previously set somewhere in Mac OS I don't know?
I have a variable set exactly like this: `export VARIABLE_NAME=VARIABLE_VALUE` I thought it would be in `~/.zshrc` or `bash_profile` but it is seen in none of those. I am now struggling to understand where its getting set and I want to reset it up. Can someone suggest easy way to do so? I am on MacO...
I have a variable set exactly like this:
When I do:
export VARIABLE_NAME=VARIABLE_VALUE
I thought it would be in ~/.zshrc
or bash_profile
but it is seen in none of those. I am now struggling to understand where its getting set and I want to reset it up. Can someone suggest easy way to do so? I am on MacOS
I am using zsh
shell. I know the command called unset VARIABLE_NAME
. However I am looking into finding root cause and removing the variable from the first place where its been set.
Variable name is JWT_SECRET
**Update:**
I tried running grep JWT_SECRET {~/.z,/etc/z}{shenv,profile,shrc,login}
as [proposed by @nohillside](https://apple.stackexchange.com/a/460904)
I have configured my zsh to use ohmyzsh.
Here's how output looks like:

echo $SHELL $ZSH_VERSION $BASH_VERSION
I get: /bin/zsh 5.9
Here's what I have in my ~/.zshrc:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
DISABLE_AUTO_TITLE="true"
PS1="%1d %& # "
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
ENABLE_CORRECTION="true"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export SU_PASSWORD=
export SU_USERNAME=
export PATH="/Users//bin:$PATH"
Shivam Sahil
(113 rep)
Jun 10, 2023, 04:31 AM
• Last activity: Jun 11, 2023, 11:04 AM
29
votes
5
answers
131195
views
How do I add a directory to PATH when using `zsh` in Sierra
In [macOS Sierra][1] 10.12.x, what is the modern way to add a directory to the [PATH environment variable][2] that can work across shells or specifically work with [*zsh*][3] shell (I switched from the default [bash][4] to [zsh][3]). I have seen some Questions and Answers such as [this one](https://...
In macOS Sierra 10.12.x, what is the modern way to add a directory to the PATH environment variable that can work across shells or specifically work with *zsh* shell (I switched from the default bash to zsh ).
I have seen some Questions and Answers such as [this one](https://apple.stackexchange.com/q/12629/17907) that are bash-specific. And I have seen some such as [this one](https://apple.stackexchange.com/q/106355/17907) about launchd but it seems I've read launchd is not the right right in later versions of macOS (not sure). I could find no specific references for Sierra, so I am posting now.
I am trying to install Maven with instructions saying:
>Add the bin directory of the created directory apache-maven-3.3.9 to the PATH environment variable
Basil Bourque
(13982 rep)
Mar 6, 2017, 03:23 AM
• Last activity: Mar 14, 2023, 09:24 PM
6
votes
2
answers
7450
views
How do I find where an environmental variable got set?
I installed a program to try it out, and decided I didn't like it so I moved the app to the trash. Today, in my shell, I noticed that there are a couple of PROGRAMNAME_BLAHBLAH environmental variables set. I'd like to remove those, too. I don't even have a .bashrc or .bash_login, so I grepped every...
I installed a program to try it out, and decided I didn't like it so I moved the app to the trash.
Today, in my shell, I noticed that there are a couple of PROGRAMNAME_BLAHBLAH environmental variables set. I'd like to remove those, too.
I don't even have a .bashrc or .bash_login, so I grepped every file I could think of (~/.* ~/Library/* /Library/* /etc/*). The only place these variables turned up was a file ~/.MacOSX/environment.plist, so I removed it from there (Xcode can edit binary plists), but new shells still have these variables set.
What other files does Mac OS X 10.7's terminal/bash run on startup? How might these variables get set?
Or is it something funny like "need to reboot after editing environment.plist"?
Ken
(4292 rep)
May 20, 2012, 02:11 PM
• Last activity: Feb 28, 2023, 11:14 PM
4
votes
1
answers
278
views
How to set PATH and other env vars for apps with "Reopen windows when logging back in"?
**EDIT in 2023**: I have macOS 13.2 Ventura and vscode 1.74.3 installed now, and this problem isn't reproducing the same way anymore. It looks like this is due to a [relatively new](https://code.visualstudio.com/updates/v1_36#_launch-terminals-with-clean-environments) vscode feature, [Terminal Envir...
**EDIT in 2023**: I have macOS 13.2 Ventura and vscode 1.74.3 installed now, and this problem isn't reproducing the same way anymore. It looks like this is due to a [relatively new](https://code.visualstudio.com/updates/v1_36#_launch-terminals-with-clean-environments) vscode feature, [Terminal Environment inheritance](https://code.visualstudio.com/docs/terminal/advanced#_environment-inheritance) which is running the login shell:
> When VS Code is opened, it launches a login shell environment in order to source a shell environment. This is done because developer tools are often added to the
$PATH
in a shell launch script like ~/.bash_profile
.
This doesn't change the question, about a general fix without every app needing to add this custom workaround.
---
I have the option "Reopen windows when logging back in" set, which on my 11.6 macbook will reopen apps like vscode and iTerm2 after I restart. I want the reopened windows to have the expected environment variables set.
Most apps will reopen with no problem, but in vscode I'll get the error The terminal process failed to launch: Path to shell executable "pwsh" does not exist.
As far as I can tell, the problem is related to the system procedure for creating PATH
[not running for windows reopened at login](https://apple.stackexchange.com/a/106814/325877) . By launching bash I can see the process PATH
environment variable is something like /usr/bin:/bin:/usr/sbin:/sbin
which explains the "pwsh" does not exist
error... (because pwsh
is in /usr/local/bin/
which normally is in my PATH
but is missing here.)
I could solve the immediate problem by specifying the full path to my shell executable in my vscode config, but other tools in /etc/paths
wouldn't be included in PATH
automatically either.
Is there some macOS setting I can change so that reopened windows have the right environment variables?
Or, I see that when iTerm2 reopens it starts my pwsh
shell and somehow has the correct PATH
-- could the vscode app copy the startup logic from iTerm2 to start with the right environment variables?
Carl Walsh
(355 rep)
Oct 27, 2021, 11:44 PM
• Last activity: Feb 9, 2023, 12:31 AM
204
votes
1
answers
261114
views
ZSH: .zprofile, .zshrc, .zlogin - What goes where?
Now that I've upgraded to Catalina and I am using the new ZSH shell, I've noticed that `~/.bash_profile` has been replaced with `~/.zprofile` and since installing iTerm2 shell integration, it added a `~/.zshrc` file. Looking at the [ZSH documentation on Startup/Shutdown Files][1], there are a number...
Now that I've upgraded to Catalina and I am using the new ZSH shell, I've noticed that
~/.bash_profile
has been replaced with ~/.zprofile
and since installing iTerm2 shell integration, it added a ~/.zshrc
file.
Looking at the ZSH documentation on Startup/Shutdown Files , there are a number of files (located in the home directory $HOME
or ~/
):
* .zprofile
(login shell)
* .zshenv
(environment variables)
* .zshrc
(interactive shell)
* .zlogin
(login shell)
* .zlogout
(when the shell exits)
What is also confusing is that ~/.zprofile
and ~/.zlogin
are both for login shells, so, things can get confusing as to what to put where.
**What startup/shutdown files should be used when setting up the ZSH shell environment and how/what should they be configured?**
Allan
(105480 rep)
Apr 17, 2020, 10:23 AM
• Last activity: Jan 31, 2023, 04:32 PM
Showing page 1 of 20 total questions