Linux Directory Structure and File System Hierarchy Standard (FHS)

Linux में सब कुछ एक single tree में root / से शुरू होता है, कोई drive letters नहीं, और Filesystem Hierarchy Standard (FHS) यह standardize करता है हर top-level directory का purpose क्या है।

10 min read · 7 cards · 2 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

एक Tree, कोई Drive Letters नहीं

अगर आप Windows से आ रहे हैं, आप C:\, D:\, और अलग drives के आदी हैं। Linux इसे बिल्कुल अलग तरीके से handle करता है: हर चीज़ एक single tree में रहती है, root से शुरू होकर, जिसे सिर्फ़ / (एक forward slash) लिखा जाता है।

कोई भी अतिरिक्त disk, USB drive, या network share अपना खुद का letter नहीं पाता; इसके बजाय इसे इस एक tree के अंदर कहीं mount किया जाता है, तो यह बस एक और folder की तरह दिखता है। एक बार जब आप यह समझ लेते हैं, हर path आपको बताता है वह चीज़ tree में कहाँ बैठती है, बिना किसी अलग drive को track किए।

Theory

Root और Standard Layout

Root directory, /, tree का top है; हर चीज़ else इसके नीचे रहती है। पर सिर्फ़ एक single tree होना काफ़ी नहीं है, अगर हर system अपनी directories को अलग तरीके से arrange करे तो चीज़ें confusing हो जातीं।

यहीं Filesystem Hierarchy Standard (FHS) काम आता है। FHS standardize करता है हर top-level directory का उद्देश्य क्या होना चाहिए, ताकि configuration files, home directories, और programs हमेशा predictable जगहों पर मिलें, चाहे आप किस भी Linux distribution पर हों।

At a glance

Directoryइसमें क्या होता है
/पूरे tree की root; हर चीज़ के नीचे यही बैठता है
/binEssential user commands (ls, cp जैसे binaries)
/etcSystem-wide configuration files
/homeहर user की personal home directory
/varVariable data: logs, spool files, चीज़ें जो grow होती हैं
/tmpTemporary files, periodically cleared
/usrUser programs और read-only shared resources
/devDevice files, hardware को files की तरह represent करते हुए

Formula

आपका Work कहाँ रहता है: /home

जिस directory से आप lab में सबसे ज़्यादा deal करेंगे वह /home है। हर student का अपना subdirectory होता है इसके अंदर (जैसे /home/riya), जिसमें उनकी files, scripts, और personal work होता है। जब आप log in करते हैं, आप typically अपनी /home directory में शुरू करते हैं, आपका अपना corner पूरे tree के अंदर।

Quiz

एक system administrator को एक service की configuration change करनी है। FHS के अनुसार, वे किस top-level directory में देखेंगे?

  1. /tmp, क्योंकि configuration temporary होता है
  2. /etc, जो system-wide configuration files रखता है
  3. /home, क्योंकि configuration एक personal setting है
  4. /dev, क्योंकि configuration hardware को control करता है
Show the answer

/etc, जो system-wide configuration files रखता है

/etc ठीक वह जगह है FHS system-wide configuration files के लिए designate करता है। Option A ग़लत है: /tmp temporary files के लिए है जो periodically clear होती हैं, persistent configuration के लिए नहीं। Option C confuse करता है: /home per-user personal files के लिए है, system-wide settings के लिए नहीं। Option D ग़लत है: /dev hardware को device files की तरह represent करता है, configuration text files को नहीं। FHS याद रखिए: configuration = /etc, हमेशा।

Think first

Directory Layout को Standardize क्यों करें?

अगर हर Linux distribution अपनी directories खुद arrange कर सकती है, FHS जैसा एक standard follow करने से actually क्या फ़ायदा मिलता है? फिर tap कीजिए।

Show the answer

FHS portability और predictability देता है। बिना किसी shared standard के, हर distribution configuration files, programs, और logs को अलग जगह रख सकती थी, तो कोई भी command, script, या admin के पास मौजूद knowledge जो एक system पर काम करती है, अगली पर टूट जाती। FHS के साथ, आप जानते हैं configuration /etc में मिलेगी, आपकी files /home में, temporary data /tmp में, चाहे आप किसी भी distribution पर हों। यह scripts को portable बनाता है, documentation को accurate रखता है, और नए admins को fast onboard करने देता है क्योंकि layout familiar रहता है। Standardization यहाँ किसी भी single distribution की help नहीं करती; यह पूरे ecosystem को coherent और predictable रखती है।

Summary

Key takeaways

  • Linux में सब कुछ एक single tree है, root / से शुरू होता हुआ; कोई drive letters नहीं।
  • Extra disks और drives इस एक tree के अंदर mount होती हैं, अलग letters नहीं पाती।
  • FHS standardize करता है हर top-level directory का उद्देश्य क्या है, distributions के across।
  • Key directories: / (root), /bin (essential commands), /etc (configuration), /home (user files), /var (variable data), /tmp (temporary), /usr (programs), /dev (devices)।
  • आपकी personal files /home में रहती हैं; system-wide configuration /etc में रहता है।
  • Standardization portability देती है: एक standard layout जानने वाली commands और knowledge हर distribution पर काम करती हैं।
  • Memory hook: एक tree, root से शुरू; /etc configs, /home आप, /tmp temporary।

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from Introduction to Linux Operating System

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati

Linux Directory Structure and File System Hierarchy Standard (FHS) · Linux Operating System (LOS) (Minor-04) · Gri-Learn