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,
- Fix - sudo: systemctl: command not found
- How to know the version of Ubuntu
- [Fix] Ubuntu E: Unable to locate package sudo error
- How to install Apache Maven on Ubuntu
- Steps to Kill a Running Process in Ubuntu Linux
- How to know current Ubuntu Linux version via terminal command
- How to stop/start/restart apache server using command [Ubuntu]
- Fix: Ubuntu (Linux) - bash: sudo: command not found error
- Ubuntu: How to search for a package to install using apt in Terminal
- Fix: E: Command line option --installed is not understood in combination with the other options
- How to install Python on Ubuntu
- Ubuntu Linux: How to Login as root User
- Access Windows share folder in Ubuntu Device in Network
- Add a User as a Sudoer Using Ubuntu Linux Command Line Terminal
- Install Oh My Zsh on Ubuntu Docker complete steps
- Fix: Make makefile:31 Error 127 (GCC)
- [fix] openssl No such file or directory error C++
- How to install zsh shell on Ubuntu
- Install Golang (Go) on Ubuntu
- Ubuntu Linux: Unzip a zip file using Terminal
- Where are Environment Variables stored in Ubuntu
- apt-get list --installed packages in Ubuntu Linux
- Ubuntu: List all Installed Packages using apt
- Quick steps to install Nginx on Ubuntu Linux
- How to kill service running on a port on Ubuntu Linux
More Posts:
- Docker - ERRO[1010] error waiting for container in Terminal - Docker
- [Fix] Office 365 Sharepoint One Drive Error: Something went wrong. This is a temporary issue - SharePoint
- [fix] docker exec requires at least 2 arguments - Docker
- JavaScript: Convert an Image into Base64 String - JavaScript
- Python: How to Plot a Histogram using Matplotlib and data as list - Python
- Check if String Contains a Substring - Python - Python
- Read file from Windows CMD (Command Line) - Windows
- Fix - cd: no such file or directory: .zshrc - zsh