{"id":28565,"date":"2026-02-25T13:34:07","date_gmt":"2026-02-25T12:34:07","guid":{"rendered":"https:\/\/contabo.com\/blog\/?p=28565"},"modified":"2026-05-15T18:45:14","modified_gmt":"2026-05-15T16:45:14","slug":"how-to-set-and-list-linux-environment-variables","status":"publish","type":"post","link":"https:\/\/contabo.com\/blog\/how-to-set-and-list-linux-environment-variables\/","title":{"rendered":"How to Set and List Environment Variables in Linux"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"630\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN.webp\" alt=\"Set and List Environment Variables in Linux\" class=\"wp-image-28634\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN.webp 1200w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN-600x315.webp 600w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN-768x403.webp 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>Every Linux process inherits a set of environment variables from its parent. These key-value pairs control how shells behave, where programs look for executables, and which configuration a running application picks up. Get them wrong and your deployment breaks at 2 AM. Get them right and you&#8217;ve got a clean, portable system config that travels with your user profile or your entire server.<\/p>\n\n\n\n<p>Whether you&#8217;re configuring a fresh <a href=\"https:\/\/contabo.com\/en\/vps\/\">VPS<\/a>, debugging a broken <a href=\"https:\/\/contabo.com\/en\/ci-cd-pipelines\/\">CI <\/a>pipeline, or deploying a Python app that refuses to find its database, environment variables are at the center of it. They&#8217;re one of those foundational Linux concepts that you&#8217;ll use every single day once you understand them.<\/p>\n\n\n\n<p>This guide walks through the commands you&#8217;ll actually use day to day: listing, printing, setting, persisting, and deleting Linux environment variables. We&#8217;ll also cover best practices and common pitfalls that trip up even experienced sysadmins.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-are-environment-variables-in-linux\">What Are Environment Variables in Linux<\/h2>\n\n\n\n<p>Environment variables are dynamic key-value pairs that shape how shells and processes behave on a Linux system. Run <code><strong>printenv<\/strong> <\/code>in a terminal and you&#8217;ll see dozens of them: PATH tells the shell where to find executables, HOME points to your user directory, SHELL identifies which shell you&#8217;re running, and LANG sets your locale.<\/p>\n\n\n\n<p>Admins use them to share configuration across applications without hardcoding values. A single <code><strong>PATH<\/strong> <\/code>variable, for example, lets every program on the system locate binaries without each one maintaining its own search list. Think of environment variables as a shared bulletin board that every process on the system can read.<\/p>\n\n\n\n<p>Linux draws a line between two types of variables. Environment variables have a global scope. They&#8217;re visible to child processes, subshells, and any program launched from that session. Shell variables, on the other hand, exist only in the current session. Spawn a subshell with <code><strong>bash<\/strong> <\/code>and they vanish.<\/p>\n\n\n\n<p>That distinction matters more than it sounds. It&#8217;s the reason your script works perfectly when you run it interactively but falls over when launched by cron, systemd, or another user. The calling process doesn&#8217;t carry your shell variables along, and the script finds an empty value where it expected a path.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-manage-linux-environment-variables\">How to Manage Linux Environment Variables<\/h2>\n\n\n\n<p>Managing environment variables on a Linux system means knowing four operations: list them, print a specific one, set new ones, and remove what you don&#8217;t need. Everything below works on any standard Linux distribution, from Ubuntu and Debian to CentOS and Arch. Connect via SSH or open your local terminal and you&#8217;re ready to go.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-list-environment-variables-in-linux\">How to List Environment Variables in Linux<\/h3>\n\n\n\n<p>The fastest way to list environment variables in Linux is the <code><strong>printenv<\/strong> <\/code>command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>printenv<\/code><\/pre>\n\n\n\n<p>That dumps every variable and its value to stdout. The output gets long fast, so pipe it through <code><strong>less<\/strong> <\/code>for something scrollable:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>printenv | less<\/code><\/pre>\n\n\n\n<p>The <strong><code>env <\/code>command<\/strong> works almost identically to <strong><code>printenv<\/code><\/strong>. Where things differ: the <strong><code>set <\/code>command<\/strong> in Linux prints both environment and shell variables, giving you the full picture. If you only want shell variables, filter with <strong><code>grep<\/code><\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set | grep -i my_var<\/code><\/pre>\n\n\n\n<p>Some variables you&#8217;ll see constantly across Linux distributions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>PATH<\/strong> <\/code>&#8211; directories the shell searches for executable files<\/li>\n\n\n\n<li><code><strong>HOME<\/strong> <\/code>&#8211; the current user&#8217;s home directory<\/li>\n\n\n\n<li><code><strong>USER<\/strong> <\/code>&#8211; the logged-in user account name<\/li>\n\n\n\n<li><code><strong>SHELL<\/strong> <\/code>&#8211; path to the current user&#8217;s shell<\/li>\n\n\n\n<li><code><strong>PWD<\/strong> <\/code>&#8211; the current working directory<\/li>\n\n\n\n<li><code><strong>EDITOR<\/strong> <\/code>&#8211; the system&#8217;s default text editor<\/li>\n<\/ul>\n\n\n\n<p>These come pre-set on virtually every Linux distribution. You can define your own for any purpose: custom application configs, deployment flags, service endpoints. That&#8217;s where things get interesting.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-print-environment-variables-in-linux\">How to Print Environment Variables in Linux<\/h3>\n\n\n\n<p>To print a single environment variable in Linux, use the <code><strong>echo<\/strong> <\/code>command with a dollar sign prefix:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $PATH<\/code><\/pre>\n\n\n\n<p>The <strong>linux <code>echo <\/code>command<\/strong> reads the variable&#8217;s current value and writes it to the terminal. It&#8217;s case-sensitive, so <strong><code>$<\/code><\/strong><code><strong>path<\/strong> <\/code>and <code><strong>$PATH<\/strong><\/code> are different things.<\/p>\n\n\n\n<p>You can also use <code><strong>printenv<\/strong> <\/code>with the variable name directly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>printenv HOME<\/code><\/pre>\n\n\n\n<p>Need to check whether a variable exists at all? Pipe <code><strong>printenv<\/strong> <\/code>through <strong><code>grep<\/code><\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>printenv | grep USER<\/code><\/pre>\n\n\n\n<p>For querying multiple variables at once:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>printenv HOME PATH SHELL<\/code><\/pre>\n\n\n\n<p>Each value prints on its own line. Quick, no fuss. This is handy when you&#8217;re writing a setup script and need to confirm several values are in place before proceeding.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-set-environment-variable-in-linux-using-export\">Set Environment Variable in Linux Using Export<\/h3>\n\n\n\n<p>The <strong><code>export <\/code>command<\/strong> in Linux creates a temporary global environment variable. Here&#8217;s the basic syntax:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export MY_VAR=\"some_value\"<\/code><\/pre>\n\n\n\n<p>That variable is now visible to the current shell and any child process you spawn from it. Print it to confirm:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $MY_VAR<\/code><\/pre>\n\n\n\n<p>You can assign multiple values separated by colons, which is how <code><strong>PATH<\/strong> <\/code>works:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export PATH=\"$PATH:\/opt\/myapp\/bin\"<\/code><\/pre>\n\n\n\n<p>Here&#8217;s the catch: this is temporary. Reboot your system, open a new terminal session, and it&#8217;s gone. The <strong>linux <code>export <\/code>command<\/strong> only affects the running session and its children. This trips up beginners constantly. They set a variable, it works, they reboot, and it&#8217;s vanished.<\/p>\n\n\n\n<p>For a local shell variable (one that doesn&#8217;t propagate to child processes), skip the export keyword:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>my_local_var=\"test\"<\/code><\/pre>\n\n\n\n<p>Convention says lowercase for local, uppercase for global. Stick to it. Future you will appreciate the clarity when you&#8217;re troubleshooting at midnight.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-make-persistent-environment-variables\">How to Make Persistent Environment Variables<\/h3>\n\n\n\n<p>Temporary variables disappear on reboot. For permanent environment variables in Linux, you need to write them into configuration files. Which file depends on who should see the variable.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-user-specific-environment-variables\">User-Specific Environment Variables<\/h4>\n\n\n\n<p>Edit the <strong><code>bashrc <\/code>file<\/strong> to set variables that persist for a single user. Open it with any text editor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano ~\/.bashrc<\/code><\/pre>\n\n\n\n<p>Add your export statement at the bottom:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export API_URL=\"https:\/\/api.example.com\"<\/code><\/pre>\n\n\n\n<p>Save and exit. The variable won&#8217;t take effect in your current session until you reload the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source ~\/.bashrc<\/code><\/pre>\n\n\n\n<p>The <strong><code>source bashrc<\/code><\/strong> command re-reads the file without requiring you to log out and back in. It&#8217;s the single most common command people forget when they add a new variable and wonder why it doesn&#8217;t show up.<\/p>\n\n\n\n<p>You can also use <strong><code>~\/.profile<\/code><\/strong> if you need variables available in login shells. The distinction: <strong><code>.bashrc<\/code><\/strong> runs for every interactive shell, <strong><code>.profile<\/code><\/strong> runs once at login. Pick the one that matches your use case. If you&#8217;re not sure, <strong><code>.bashrc<\/code><\/strong> is the safer default for most scenarios.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-system-wide-environment-variables\">System-Wide Environment Variables<\/h4>\n\n\n\n<p>For variables every user on the system needs, edit <code><strong>\/etc\/environment<\/strong><\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/environment<\/code><\/pre>\n\n\n\n<p>Add plain key-value pairs without the <code><strong>export<\/strong> <\/code>keyword:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>JAVA_HOME=\"\/usr\/lib\/jvm\/java-17\"<\/code><\/pre>\n\n\n\n<p>Save, then reboot or re-login for changes to take effect.<\/p>\n\n\n\n<p>An alternative approach: create a shell script in <strong><code>\/etc\/profile.d\/<\/code><\/strong>. This directory is sourced at login for all users:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/profile.d\/custom_env.sh<\/code><\/pre>\n\n\n\n<p>Inside the file, use <code><strong>export<\/strong> <\/code>as you normally would:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export LOG_LEVEL=\"info\"<\/code><\/pre>\n\n\n\n<p>Give it a descriptive filename. You&#8217;ll thank yourself when the directory has 15 scripts and you need to find the one that sets the proxy config. Reboot to apply, then confirm with <strong><code>printenv<\/code><\/strong>. The <strong><code>\/etc\/profile.d\/<\/code><\/strong> approach is cleaner for managing multiple groups of variables because each concern gets its own file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-delete-environment-variables-in-linux\">Delete Environment Variables in Linux<\/h3>\n\n\n\n<p>The <code><strong>unset<\/strong> <\/code>command removes an environment variable from the current session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>unset MY_VAR<\/code><\/pre>\n\n\n\n<p>Gone. But only for this session. If that variable lives in <strong><code>~\/.bashrc<\/code><\/strong> or <strong><code>\/etc\/environment<\/code><\/strong>, it comes right back after a reboot. The <code><strong>unset<\/strong> <\/code>command is temporary by design.<\/p>\n\n\n\n<p>To permanently remove an environment variable in Linux, open the config file where it&#8217;s defined and delete (or comment out) the line. Commenting is safer and saves you from future grief:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># export API_URL=\"https:\/\/api.example.com\"<\/code><\/pre>\n\n\n\n<p>A hash symbol at the start disables it without destroying it. When the inevitable &#8220;why did we remove that?&#8221; question comes up three weeks later, you can uncomment it in seconds instead of reconstructing the value from memory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-using-environment-variables-in-development\">Using Environment Variables in Development<\/h2>\n\n\n\n<p>Here&#8217;s where environment variables earn their keep. Storing database credentials, <a href=\"https:\/\/contabo.com\/en\/contabo-api\/\">API <\/a>keys, and service URLs as environment variables keeps them out of your codebase. No secrets in version control. No accidentally pushing a production database password to a public GitHub repo. If you&#8217;ve ever seen a company in the news for leaked credentials, odds are good someone skipped this step.<\/p>\n\n\n\n<p>The pattern works like this. You define different variables for each stage:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export APP_ENV=\"staging\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>export DB_HOST=\"staging-db.internal\"<\/code><\/pre>\n\n\n\n<p>When you deploy to production, you swap the values. The application code reads <strong><code>$APP_ENV<\/code><\/strong> and <strong><code>$DB_HOST<\/code><\/strong> and behaves accordingly. No code changes between environments. The same Docker image, the same binary, the same script runs everywhere with different behavior based purely on the variables it inherits.<\/p>\n\n\n\n<p>This approach also simplifies automation. A deployment script can set environment variables before launching an application, and every config value flows from one place. Compare that to maintaining separate config files per environment, each one a potential source of drift and mistakes. Three environments with five config files each is fifteen files to keep in sync. Environment variables cut that down to one mechanism.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-environment-variables-best-practices\">Environment Variables Best Practices<\/h2>\n\n\n\n<p>Knowing the commands is half the battle. Using them well is what separates a clean system from one that breaks in mysterious ways.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-use-descriptive-variable-names\">Use Descriptive Variable Names<\/h3>\n\n\n\n<p><strong>VAR1<\/strong> tells you nothing. <strong>POSTGRES_CONNECTION_STRING<\/strong> tells you everything. Descriptive names prevent the scenario where you&#8217;re staring at 40 exported variables and can&#8217;t figure out which one controls the log output directory.<\/p>\n\n\n\n<p>Follow a consistent naming convention. Prefix related variables with the application or service name: <strong>MYAPP_DB_HOST<\/strong>, <strong>MYAPP_DB_PORT<\/strong>, <strong>MYAPP_LOG_PATH<\/strong>. When another team member inherits your server, they&#8217;ll figure out the system in minutes instead of hours. Vague names create tribal knowledge. Descriptive names create documentation that lives where it&#8217;s actually used.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-manage-variable-scope-correctly\">Manage Variable Scope Correctly<\/h3>\n\n\n\n<p>A common trap: you create a shell variable with the same name as a global environment variable. The shell doesn&#8217;t know which one you mean, and suddenly your application reads the wrong value. I&#8217;ve seen this tank a production deployment because someone had a local <code><strong>PATH<\/strong> <\/code>override they&#8217;d forgotten about.<\/p>\n\n\n\n<p>Use local (shell) variables for throwaway work: a loop counter in a script, a temp file path, a one-off test value. Use global environment variables for anything shared across processes: database URLs, log levels, feature flags.<\/p>\n\n\n\n<p>Stick to the convention. Lowercase for local shell variables, uppercase for globals. <code><strong>PATH<\/strong> <\/code>is system-wide. <strong><code>path_to_tmp<\/code><\/strong> is session-only. That visual distinction keeps you honest.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-audit-environment-variables-regularly\">Audit Environment Variables Regularly<\/h3>\n\n\n\n<p>Variables accumulate. Old API keys linger. Deprecated service URLs stick around. Someone set a debug flag six months ago and forgot about it, and now your production server is writing verbose logs to a disk that&#8217;s 94% full. This happens more often than anyone likes to admit.<\/p>\n\n\n\n<p>Dump your current variables to a file periodically:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set &gt; env_audit_$(date +%Y%m%d).txt<\/code><\/pre>\n\n\n\n<p>Compare against previous dumps. Remove what&#8217;s dead. Rotate credentials that show up in the export list. Check that nothing sensitive leaked into a system-wide file that every user can read. This isn&#8217;t glamorous work, but it&#8217;s the kind of hygiene that prevents security incidents and mysterious production failures. Treat it like changing the oil: boring, necessary, catastrophic if neglected.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-linux-environment-variables-faq\">Linux Environment Variables FAQ<\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1773928323844\"><strong class=\"schema-faq-question\">How Do I See Environment Variables in Linux<\/strong> <p class=\"schema-faq-answer\">Run <strong>printenv<\/strong> or <strong>env<\/strong> to list all environment variables. Use <code><strong>echo $VARIABLE_NAME<\/strong> <\/code>to check a specific one. The <code><strong>set<\/strong> <\/code>command shows both shell and environment variables together. Pipe any of these through <code><strong>grep<\/strong> <\/code>to filter for what you need. For a scrollable view of all variables, try <strong><code>printenv | less<\/code><\/strong>.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1773928335198\"><strong class=\"schema-faq-question\">What Are the Types of Environment Variables<\/strong> <p class=\"schema-faq-answer\">Linux has two main categories. Local (shell) variables exist only in the current session and disappear when you close the terminal or spawn a subshell. Global environment variables persist across child processes and come in two flavors: user-specific (stored in <strong><code>~\/.bashrc<\/code><\/strong> or <strong><code>~\/.profile<\/code><\/strong>) and system-wide (stored in <strong><code>\/etc\/environment<\/code><\/strong> or scripts in <strong><code>\/etc\/profile.d\/<\/code><\/strong>).<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1773928345061\"><strong class=\"schema-faq-question\">Local vs Global Environment Variables<\/strong> <p class=\"schema-faq-answer\">Local variables are confined to the current shell. Launch a subshell and they&#8217;re gone. Global variables propagate to every child process, subshell, and program started from that session. If your script needs a value and it&#8217;s running as a child process, it must be a global (exported) variable. Use lowercase names for local variables and uppercase for global ones to keep them distinct.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1773928353819\"><strong class=\"schema-faq-question\">Where Are Environment Variables Stored in Linux<\/strong> <p class=\"schema-faq-answer\">User-level persistent variables typically live in <strong><code>~\/.bashrc<\/code><\/strong> or <strong><code>~\/.profile<\/code><\/strong> in the user&#8217;s home directory. System-wide variables go in <strong><code>\/etc\/environment<\/code><\/strong> or as individual shell scripts in <strong><code>\/etc\/profile.d\/<\/code><\/strong>. Temporary variables exist only in memory for the current session and aren&#8217;t stored in any file. They vanish on logout or reboot.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1773928362895\"><strong class=\"schema-faq-question\">How to Add Environment Variable in Linux<\/strong> <p class=\"schema-faq-answer\">For a temporary variable, use <strong><code>export VAR=\"value\"<\/code><\/strong> in the terminal. Add that same export line to <strong><code>~\/.bashrc<\/code><\/strong> and run <strong><code>source ~\/.bashrc<\/code><\/strong> to load it immediately, for a permanent user-level variable. For a system-wide variable, add the key-value pair to <strong><code>\/etc\/environment<\/code><\/strong> (without the export keyword) and reboot or re-login.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Set, list, persist, and remove Linux environment variables without breaking your shell or deployments. Highlights printenv, env, export, .bashrc, \/etc\/environment, development use cases, and best practices.<\/p>\n","protected":false},"author":44,"featured_media":28634,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18],"tags":[510,4238],"ppma_author":[3402],"class_list":["post-28565","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-linux","tag-linux-environment-variables"],"uagb_featured_image_src":{"full":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN.webp",1200,630,false],"thumbnail":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN-150x150.webp",150,150,true],"medium":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN-600x315.webp",600,315,true],"medium_large":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN-768x403.webp",768,403,true],"large":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN.webp",1200,630,false],"1536x1536":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN.webp",1200,630,false],"2048x2048":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2026\/02\/blog-head_guide-set-and-list-linux-environment-variables_EN.webp",1200,630,false]},"uagb_author_info":{"display_name":"Milan Ivanovic","author_link":"https:\/\/contabo.com\/blog\/author\/milan\/"},"uagb_comment_info":0,"uagb_excerpt":"Set, list, persist, and remove Linux environment variables without breaking your shell or deployments. Highlights printenv, env, export, .bashrc, \/etc\/environment, development use cases, and best practices.","authors":[{"term_id":3402,"user_id":0,"is_guest":1,"slug":"contabro","display_name":"ContaBro","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"","first_name":"","job_title":"","description":""}],"_links":{"self":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/28565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/users\/44"}],"replies":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/comments?post=28565"}],"version-history":[{"count":11,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/28565\/revisions"}],"predecessor-version":[{"id":30579,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/28565\/revisions\/30579"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media\/28634"}],"wp:attachment":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media?parent=28565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/categories?post=28565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/tags?post=28565"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=28565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}