Changing permissionsand ownerships in Linux in Hindi

Linux mein file aur directory permissions aur ownerships ko badalna bahut mahatvapurna hai.

Changing permissionsand ownerships in Linux in Hindi

Permissions, aapke files aur directories tak pahunchne aur unpar kis prakar ka access diya jayega, aur ownership, yani kaun file ya directory ka malik hai, in sabko control karne mein madadgar hote hain.

File Permissions (File Permissions):

Linux mein file permissions ko symbolically ya numerically set kiya ja sakta hai.

Symbolic Method (Symbolic Tarika):

  • chmod command ka istemal karke aap permissions ko symbolically set kar sakte hain. Yeh method user (u), group (g), aur others (o) ke liye alag-alag permissions (read, write, execute) ko set karta hai.

  • For example, agar aap ek file “example.txt” ke owner ko read aur write permissions dena chahte hain, to aap yeh command istemal karenge: chmod u+rw example.txt

Numeric Method (Sankhyatmak Tarika):

  • Permissions ko numeric values se set kiya ja sakta hai. Har permission ko ek numeric value se represent kiya jata hai: read (4), write (2), execute (1), aur no permission (0).
  • Yadi aap ek file “example.txt” ke owner ko read (4) aur write (2) permissions dena chahte hain, to aap yeh command istemal karenge:
    chmod 600 example.txt

File Ownership (File Ownership):

Linux mein har file ya directory ek owner aur ek group ke saath aata hai. Ownership change karne ke liye chown command ka istemal kiya jata hai.

Owner Change (Owner Badalna):

  • File ya directory ke owner ko badalne ke liye aap chown command ka istemal kar sakte hain. For example, agar aap “example.txt” file ka owner “john” se “jane” par badalna chahte hain, to aap yeh command istemal karenge: sudo chown jane example.txt

Group Change (Group Badalna):

  • Group ownership ko badalne ke liye bhi chown command ka istemal kiya jata hai. For example, agar aap “example.txt” file ka group owner “users” se “staff” par badalna chahte hain, to aap yeh command istemal karenge:
    sudo chown :staff example.txt

File permissions aur ownerships ko control karke, aap apne files aur directories ke access aur security ko manage kar sakte hain. Yeh functionality Linux operating system ki flexibility aur security ka ek mahatvapurna hissa hai.

Leave a Comment