LATEST ALERT

Setting Environment Variables: Linux, Windows & Mac me Environment Variables kaise set kare (Beginner Guide)

Setting Environment Variables – Complete Guide

Setting Environment Variables – Complete Beginner to Advanced Guide

Setting Environment Variables Guide

Environment Variables software development aur system configuration ka ek bahut hi important concept hai. Agar aap programming, blogging, server management ya application deployment se jude hue hain, to environment variables ko samajhna aapke liye mandatory ho jata hai.

Is detailed guide me hum dekhenge: Windows, Linux aur Mac OS me environment variables kaise set kiye jate hain, unka real-world use kya hai, aur kaise aap unhe secure aur professional way me manage kar sakte hain.

---

Environment Variables kya hote hain?

Environment Variables system-level dynamic values hote hain jo operating system aur applications ko ye batate hain ki software ka behavior kaise hona chahiye. Ye variables background me kaam karte hain aur directly user ko visible nahi hote.

Simple language me kahe to environment variables ek tarah ke global settings hote hain jo kisi bhi program ko ye batate hain:

  • Program kaha install hai
  • Kaunsa environment use ho raha hai
  • Configuration values kya hain

Agar aap Blogging & SEO ya Programming Basics seekh rahe hain, to environment variables ka concept aapke liye bahut important hai.

---

Environment Variables kyu important hote hain?

Environment variables bina code change kiye software ka behavior change karne ki power dete hain. Isi wajah se ye production-level applications me extensively use kiye jate hain.

Key Benefits:
  • Security – passwords aur API keys safe rehte hain
  • Flexibility – dev, test, production easily manage
  • System-wide access
  • Automation friendly

Agar aap command line tools use karte hain to Windows CMD Basics post bhi zarur padhein.

---

Common Environment Variables List

Variable Name Description
PATH Executable programs ke location ka path
JAVA_HOME Java installation directory
NODE_ENV Node.js application environment
PYTHONPATH Python module search path
TEMP Temporary files location
---

Windows me Environment Variables kaise set kare

Method 1: Graphical Interface

Windows users ke liye GUI method sabse easy hota hai. Is method me aap manually variables add kar sakte hain bina kisi command ke.

  • This PC → Right Click → Properties
  • Advanced System Settings
  • Environment Variables
  • User ya System variables me New
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk-21
---

Method 2: CMD se

setx NODE_ENV production

Ye command permanently variable set kar deti hai. CMD restart karna zaruri hota hai.

---

Linux me Environment Variables

Temporary Variable

Linux users ke liye ye topic Linux Basics Guide ke sath deeply connected hai.

export APP_MODE=development

Permanent Variable

nano ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-21
source ~/.bashrc
---

Mac OS me Environment Variables

Mac OS Linux ke jaisa hi behave karta hai. Zyada tar systems me ZSH default shell hoti hai.

nano ~/.zshrc
export NODE_ENV=production
---

Node.js developers ke liye Environment Variables in Node.js post bahut useful rahegi.

Environment Variables ka Programming me Use

Node.js Example

console.log(process.env.NODE_ENV);

Python Example

import os
print(os.getenv("PATH"))
---

Best Practices

  • Sensitive data code me hardcode na karein
  • .env file ka use karein
  • Version control me .env ignore karein
  • Clear naming convention follow karein
---

Common Mistakes

  • PATH overwrite kar dena
  • Shell reload na karna
  • Wrong file edit karna
  • Case sensitivity ignore karna
---

Conclusion

Environment Variables ek professional developer ka sabse powerful tool hota hai. Chahe aap beginner ho ya advanced level par kaam kar rahe ho, environment variables aapke system aur application ko scalable, secure aur manageable banate hain.

Agar aap blogging, programming, server ya DevOps field me grow karna chahte hain to is topic ko ache se master karna aapke career ke liye game-changer ho sakta hai.

Related Guides

अगर आपको यह Post पसंद आई हो, तो इसे अपने मित्रों तक ज़रूर पहुंचाएँ। Infosaar को Follow करें और Tech and Java ,Python , daily job updates पढ़ें.

🌸 Infosaar 🌸

🙏 हमारे ब्लॉग पर Inspristional Stories, Java, Python, Gov.Jobs,Part-Time Jobs,Full-time Jobs से जुड़ी प्रेरणादायक पोस्ट पढ़ें।
हर दिन का एक नया अनुभव पाएँ 🙌

🔔 हमसे जुड़ें: Facebook | YouTube | Blog


© 2026 Infosaar | All Rights Reserved

एक टिप्पणी भेजें

0 टिप्पणियाँ

User's Notification>> मध्यम वर्गीय परिवार और निम्न वर्गीय परिवार के साथ एक ही समस्या है एक तो विचारों को हिंदी मीडियम से पढाई करना ,दूसरा टेक्नोलॉजी का ज्ञान शून्य होना, और जरूरी शिक्षा से भी वंचित रहना, आर्थिक स्थिति भी ठीक नहीं होना यह सब पूरी जिंदगी को संघर्ष पूर्ण बना देता है और सफलता के लिए पूरी जिंदगी सफर करना पड़ता है। इन्हीं सब चीजों को ध्यान में रखकर infosaarhub आपके लिए लाया है बेहतरीन अवसर जो नौकरी के साथ-साथ तकनीकी कौशल सीखना चाहते है या कठिन Java ,Python जैसी डिफॉल्ट कोडिंग भाषा को आसान भाषा में सीखना चाहते हैं और सरकारी नौकरी के साथ-साथ पढ़ाई करना चाहते हैं या फिर अपने बिजनेस की तैयारी कर सकते है।