{"id":11015,"date":"2024-02-25T08:29:31","date_gmt":"2024-02-25T08:29:31","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=11015"},"modified":"2024-03-14T09:56:09","modified_gmt":"2024-03-14T09:56:09","slug":"how-to-set-environment-variables-in-linux","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/","title":{"rendered":"How to Set Environment Variables in Linux"},"content":{"rendered":"\n<p>Environment variables comprise names and values that define the system environment. These variables store essential information, including paths, system names, and other configuration settings. With environment variables, you can automate tasks and control the behavior of programs within the operating system environment.<\/p>\n\n\n\n<p>Through this guide, you can set environment variables temporarily, permanently, and globally in your Linux environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Set Environment Variables in Linux?<\/strong><\/h2>\n\n\n\n<p>This article explores the following parts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set Environment Variable Temporarily<\/li>\n\n\n\n<li>Configuring Environment Variable Permanently<\/li>\n\n\n\n<li>Setting up Environment Variable Globally&nbsp;<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to Set Environment Variables Temporarily in Linux<\/strong><\/h3>\n\n\n\n<p>These steps contribute to set environment variables temporarily in the Linux system.&nbsp;<\/p>\n\n\n\n<p><strong>Step 1: View Current Environment Variables<\/strong><\/p>\n\n\n\n<p>To view all the current environment variables present in your Linux system, use the command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>printenv&nbsp;<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/9i8t5ZQpt13HLCThaUgW5DDLXC_VKkpqYJSa1E-E600EN7KUj5dnbZAiHye-zAm4FwHjkT33Q4lPFhNJDcE_drJz_vPoXclMbYHVPVuBW57bHrv8LgsiQRySmGw0hYplPnG1FAzhSHWwLklpjHKK5A\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/0eHGA21KaQTqnYbtHxoBKXXZ6x4bhA_iDgr-4qvQlouPBt2IrNvOjy4AHJ62PmTY_JFGKGAS6waZ3MpxLJpZNwxQkMMx0S22z8kBxlBwPdKhqdzXezDMYY9aWH74R5OF9hH04RpuKVqNPSo6VsrIMg\" alt=\"\"\/><\/figure>\n\n\n\n<p>You will see a list of variables along with their values on your Linux system after executing the command.&nbsp;<\/p>\n\n\n\n<p><strong>Step 2: Set Temporary Environment Variable<\/strong><\/p>\n\n\n\n<p>You can set an environment variable only for the current session. It will be removed after rebooting your system. Here is the command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>export TEST_ENV=\"Test Value\"<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/mwNw1GAK3bIQf5ZVGQO-mjDcRUNNpQI8Lzp4rXh3JWEyp7O-pXI9vq5QNR3WV6y8gJdHPwlLNxs5xz83cFefxk-hOUgYkHIntgoyMsQMWhgt3USnX_Mf5Lu5dCUS1ogAkiDvuJ9zM-A635z25Q0oxQ\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 3: Verify Environment Variable<\/strong><\/p>\n\n\n\n<p>To examine the complete list of your system\u2019s environment variables, utilize the \u201cprintenv\u201d command. However, here we will utilize the \u201cgrep\u201d command to verify only the newly created environment variable:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>printenv | grep TEST_ENV<pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/9pP0jGvm2SMCfKcQOjM2L1lJrdvJH9aKeHl9p3w5shBqR5scLZr2TIk9CKBLhcXPyvyDo270RF-Ybe0mAQbL_eaXG1Pu2Te6FSMVplBDQUocrgtx4jgiPQIXLdlWtnhoyclwcWedQ-IhTtIaYs9u_A\" alt=\"\"\/><\/figure>\n\n\n\n<p>After the successful execution of the command, the variable along with its value will be displayed on your terminal.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to Configure Environment Variables Permanently in Linux?<\/strong><\/h3>\n\n\n\n<p>Follow these steps for setting up the environment variable permanently in the Linux system.&nbsp;<\/p>\n\n\n\n<p><strong>Step 1: Access and Edit \u201c.bashrc\u201d File<\/strong><\/p>\n\n\n\n<p>The Linux operating system allows you to establish an environment variable not only for a short time but permanently. To do so, you need to make some changes in the \u201c.bashrc\u201d file:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo nano .bashrc<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/gprXVS9UYYHzdn3-a8FMAzPoXtmVHOw-A3ggAaIr9qRL9GdckHEZUA44wVLg1sBpXPJO6GSuGRw2mqIjokRTk3g_28K8RSVrmEP8qefH-T4UgXd_lRx1XzMtgFKa9oLOBw5Ek-nEaH1VeDmmGL9XgQ\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the \".bashrc\", type command at the end and close after saving the file:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>export TEST_ENV=\"Set the test value as permanent\"<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/r1h3P67LvfRqS8C0Yb5DgrJuAF3PNQOKE5nVtPThK8YEsWqOIolcX06JFVrycD_thYWWeOLETUxK042mMLKGObwlcXSAVpGK4vMKmcfa_joqwZuOhjp6xgd17INW2OG_Xggc_8Hn1OWIZq9J2M07_w\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 2: Reload \u201c.bashrc\u201d File<\/strong><\/p>\n\n\n\n<p>After editing the <strong>\u201c.bashrc\u201d<\/strong> file, you need to reload to apply the changes to the current session without rebooting your system:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>source .bashrc<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/hVnCxzTxcSqZwd22aJfxW1DzizWyADUOQPfGYbXw1M8IcWVUO4amV56w66Da7L_moKldQw4UKCPoLQYWDuDBAQiKt2paBwX5kewNcHSa9E2HcjsIQ4hjyoYSBo-QxthXvydavj5f3Ri_qvyCPFBPHw\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 3: Confirm Environment Variable<\/strong><\/p>\n\n\n\n<p>Once the \".bashrc\" file is reloaded, you can confirm whether the environment variable is set permanently by using the command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>printenv | grep TEST_ENV<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/mcLH88JQJnSOxTQOm_8-lcHsWDzZNAdrocahjuQk56Qvo2BH5bIRTKGWd0H_SGXeV719cu7fe4cjTYw5HtTgYxQ27nUuzpyYv8v7vUTq242E8LjTTHB9CPFkE1-c89My0t8TQBF4TTwlKsXdXl7xtg\" alt=\"\"\/><\/figure>\n\n\n\n<p>You can also use the \u201cenv\u201d command to view the complete list of environment variables on your Linux system:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>env&nbsp;<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/h-MfqtDb-FadPcKNJoRyJGkLR3riCa9D-EjQ2DVK22tt47uyK0AvqPwrgkKXp2AvTtFwweN4pSgq9fXKIYAPdANJP_Gy2yZEwaeFZV9YQizajZ5Q5_VFHGQvIk00bqrPyrWMwLCf06nttSfttMKTyA\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/7tY-8anbO-T-ImO5a9w4GmNH-j6uKBz7gN_m8PzvBixwc8hoEod8aqUZkkq7_FuLBCg1vrOOw8SpzIOR3xf2r7AxHe-YSJ5YsSvwQ4DNJ2hRcc1SqKWzj-5W0A0gPw5wUYg0ntUTP3yzqmCM-vXO3w\" alt=\"\"\/><\/figure>\n\n\n\n<p>After setting the environment variable permanently, you can find it <strong>(TEST_ENV=Set the test value as permanent)<\/strong> in your variables list.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to Set up Environment Variables Globally in Linux?<\/strong><\/h3>\n\n\n\n<p>With these steps, you can make environment variables globally that can be accessed by all users on the system.<\/p>\n\n\n\n<p><strong>Step 1: Create Backup of the \u201c\/etc\/profile\u201d<\/strong><\/p>\n\n\n\n<p>Before start editing the \/etc\/profile, create a backup using the provided command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo cp \/etc\/profile \/etc\/profile_backup<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/QA-slUqT6v7Cs1kcDvxwoaQZAl2MsjaPTGnPr_fzfpPTnUEiq-SKyfRfdY-Dt_WZTrrwy3PlebY7n8Em9yXRfEo1xTXpxYNdi3cin_RLdKBMHPjDvRkkLLNAfJxwSkeXvMxUVFDK1o-fTdXOqh8yxQ\" alt=\"\"\/><\/figure>\n\n\n\n<p>This process will secure your profile file if the file corrupts. Later, the file can be restored from the backup file.&nbsp;<\/p>\n\n\n\n<p><strong>Step 2: Access and Edit \u201c\/etc\/profile\u201d File<\/strong><\/p>\n\n\n\n<p>Next, open the \u201cprofile\" through command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo nano \/etc\/profile<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/3ZP_03IlUoaO8iIpE6BK3g6XzccJl21AWW8nGZNPD0o0iwrPpHVN7v1zF5iNZ7r28MLx7i9YJ50MV1n0HJsIXJeT3c3S1ubyiNXg5Yxd9ltaGJXCyLbCQuOcEB9VQb7GGFP9_u9uqV80BYG9447ogA\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the profile, scroll down to the end and type the command and then save it:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>export TEST_ENV=\"Set the test value as Global\"<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/olazfo7gxIkWysEVpVssdRMVn42FEM8o3Q6s-dDkGbnDXNUuM2b2eyvKQmr0nKqn-sDt2I9IL-QW4NG8QymahE35TkCCKcT3Zss9gF3I7hp53uUnlxC6I2u4PUWHVZAEleuYrnoGWN_BmwiOksTfqw\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 3: Reload the \u201c\/etc\/profile\u201d<\/strong><\/p>\n\n\n\n<p>From your terminal window, run the <strong>source<\/strong> command followed by <strong>\/etc\/profile<\/strong> to apply changes without rebooting you machine:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>source \/etc\/profile<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/bcNeRHOK81ng3cXS5zMarObHlEXfZXa1IBCCUm-ujqtEqdvqNdhBaOYSROCaMrdZxIgl_it5aKCbJaYosXuuCNscmILO0MdgwT7TKOHZcu4feYLNPjlpMtDsnhysJJ49rak8SGhl61rxbzvfVAb0OQ\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 4: Verify Environment Variable<\/strong><\/p>\n\n\n\n<p>Upon executing the source command, run the following command to view the environment variable is set globally:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>printenv | grep TEST_ENV<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/atLtZgY3rsthYnNP6aOXPjWC1-vFFgcOREVhBWpvjn56lmux9XEppRaAByQadp9VV0CRVQpYUOcHZiOmoDJCu-Y3EK0yN2rhiy64wluTzIoIZOZ8Xuq-f90wfCDTBghwOFnY8yPS9j4exXPgVdjMyw\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 5: Confirm Environment Variable on Another User<\/strong><\/p>\n\n\n\n<p>You can confirm whether you can access the environment variable from another user. To do so, login to another virtual environment and use the same command:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/KrlFMkTwUmd9vn7GhTPq4vBMQgDmrsrXW-PbzIouM_LRRtOfTCCOUr-WDv4h8g_iX-efSu5_lOEACGJrKxkF8op1_FQsuVaG96kj0rb2uCasRJXzwym4EUmPh8ZXrUH9JV7fLGtC2GKGC7WGSe8lAQ\" alt=\"\"\/><\/figure>\n\n\n\n<p>If you see the variable name (TEST_ENV) and its value (Test Value as Global), it shows that you have successfully set the environment variable globally.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>In Linux, you can configure an environment variable temporarily, permanently, and globally. To set up a variable utilize the <strong>export<\/strong> command followed by <strong>variable_name=value<\/strong>. However, you can make it permanent by placing it in the \u201c.bashrc\", while making it available globally, edit the <strong>\/etc\/profile<\/strong> with <strong>export variable_name=value<\/strong>.&nbsp;<\/p>\n\n\n\n<p>In this article we have explored setting up an environment variable on Linux-based systems.<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Environment variables comprise names and values that define the system environment. These variables store essential information, including paths, system names, and other configuration settings. With environment variables, you can automate tasks and control the behavior of programs within the operating system environment. Through this guide, you can set environment variables temporarily, permanently, and globally in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":11019,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[279,230],"class_list":["post-11015","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-environment-variables","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Set Environment Variables in Linux - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"Through this guide, you can set environment variables temporarily, permanently, and globally in your Linux environment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Environment Variables in Linux - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"Through this guide, you can set environment variables temporarily, permanently, and globally in your Linux environment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-25T08:29:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-14T09:56:09+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to Set Environment Variables in Linux\",\"datePublished\":\"2024-02-25T08:29:31+00:00\",\"dateModified\":\"2024-03-14T09:56:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/\"},\"wordCount\":593,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg\",\"keywords\":[\"Environment Variables\",\"Linux\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/\",\"name\":\"How to Set Environment Variables in Linux - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg\",\"datePublished\":\"2024-02-25T08:29:31+00:00\",\"dateModified\":\"2024-03-14T09:56:09+00:00\",\"description\":\"Through this guide, you can set environment variables temporarily, permanently, and globally in your Linux environment.\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg\",\"width\":1020,\"height\":600,\"caption\":\"How to Set Environment Variables in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Environment Variables in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Environment Variables in Linux - Greenwebpage Community","description":"Through this guide, you can set environment variables temporarily, permanently, and globally in your Linux environment.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Set Environment Variables in Linux - Greenwebpage Community","og_description":"Through this guide, you can set environment variables temporarily, permanently, and globally in your Linux environment.","og_url":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/","og_site_name":"Greenwebpage Community","article_published_time":"2024-02-25T08:29:31+00:00","article_modified_time":"2024-03-14T09:56:09+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to Set Environment Variables in Linux","datePublished":"2024-02-25T08:29:31+00:00","dateModified":"2024-03-14T09:56:09+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/"},"wordCount":593,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg","keywords":["Environment Variables","Linux"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/","url":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/","name":"How to Set Environment Variables in Linux - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg","datePublished":"2024-02-25T08:29:31+00:00","dateModified":"2024-03-14T09:56:09+00:00","description":"Through this guide, you can set environment variables temporarily, permanently, and globally in your Linux environment.","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Set-Environment-Variables-in-Linux.jpg","width":1020,"height":600,"caption":"How to Set Environment Variables in Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-set-environment-variables-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to Set Environment Variables in Linux"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/11015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=11015"}],"version-history":[{"count":3,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/11015\/revisions"}],"predecessor-version":[{"id":11018,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/11015\/revisions\/11018"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/11019"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=11015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=11015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=11015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}