Environment variables and PATH
cheat sheet · bash https://lab.dimsanych.ru/en/wiki/env-vars/Cheat sheet
-
echo "$PATH"its value -
envall environment variables -
printenv HOMEa single variable -
export VAR=valuefor the current session + children -
VAR=value cmdfor one command only -
source ~/.bashrcreload without a new login - permanent: ~/.bashrc (terminal) · ~/.profile (login/SSH) · /etc/environment (system-wide)
- systemd: Environment= / EnvironmentFile= ; cron: inside the script