The environment variables can be stored in various configuration files depending upon the program that you are referring to as well the scope - system-wide or user-specific.
System-Wide Environment Variables:
You can find the system-wide environment variables under /etc/environment file.
# cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
/usr/games:/usr/local/games:/snap/bin"
User-Specific Environment Variables:
Based on what shell you use, you can find them under the ~/.bashrc or ~/.zshrc files under the home directory.
Example:cat ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

Know the Temporary Environment variables:
If you are looking for the temporary environment variables set for the current session then you can make use of the printenv command.
Example:# printenv
HOSTNAME=b9fc21f2fc40
HOME=/root
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/user/bin
DEV_SERVER_URL=https://192.167.8.2:8000
PWD=/
-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Ubuntu,
- Install Oh My Zsh on Ubuntu Docker complete steps
- Installing Home-brew on Ubuntu
- Install Golang (Go) on Ubuntu
- Install specific JRE on Ubuntu using apt
- How to stop/start/restart apache server using command [Ubuntu]
- How to install zsh shell on Ubuntu
- Quick steps to install Nginx on Ubuntu Linux
- How to know current Ubuntu Linux version via terminal command
- Add new user in Ubuntu Linux using Terminal Command
- Fix Ubuntu /bin/sh: 1: zsh: not found error
- How to install Python on Ubuntu
- [Fix] Ubuntu E: Unable to locate package sudo error
- How to stop MongoDB Server running on Ubuntu
- Install postgres Client using apt-get command
- How to kill service running on a port on Ubuntu Linux
- [fix] openssl No such file or directory error C++
- Fix - sudo: systemctl: command not found
- Access Windows share folder in Ubuntu Device in Network
- Add or remove users from sudo group - Ubuntu
- Quickly install Apache Server on Ubuntu Linux
- Fix: Ubuntu (Linux) - bash: sudo: command not found error
More Posts:
- Online HTML Code Formatter (Prettier) Tool - Tools
- Installing JD Decompiler plugin in Eclipse IDE - Eclipse
- Write to File in Java using BufferedWriter - Java
- Safari Full Screen Shortcut using Keyboard [macOS] - MacOS
- Install Bash Completion on macOS - Bash
- Bypass domain name with credentials SharePoint, .Net site from IIS - SharePoint
- How to change the tab color on Microsoft Excel on Mac - MacOS
- How to Enable Developers Option in Android Phones Settings - Android