پی سی سیتی

پی سی سیتی (http://p30city.net/index.php)
-   لینوکس - linux (http://p30city.net/forumdisplay.php?f=117)
-   -   Change File Permissions آموزش چگونگی تغییر مجوز دسترسی فایلها در لینوکس فایل پرمیشن (http://p30city.net/showthread.php?t=8220)

آموزش لینوکس AP 01-16-2009 11:48 PM

Change File Permissions آموزش چگونگی تغییر مجوز دسترسی فایلها در لینوکس فایل پرمیشن
 
CHANGE FILE PERMISSIONS
مقاله آموزشی لینوکس

Maybe, you find a file that's can't be deleted in Linux Operating system. In Linux, each of file has permissions/previleges for the owner, the group and the other.So no each one can open, modify or delete the file. Each file in linux has atribut, it will appears if you try to execute command that display a list of file in directory :


http://2.bp.blogspot.com/_4Qipqxw8DV.../s320/gbr1.png

at the first column there are 10 character that's consist of :
1. first character is indicates type of file
- indicates that the type of the file is a regular file
d indicates that the type of the file is a directory
l indicates that the type of the file is a symbolic link
b indicates that the type of the file is a block special file
c indicates that the type of the file is a character special file
s indicates that the type of the file is a socket link

2. Three character after the first character is indicates the permission for user that owned the file (so based on the example above, the permission for user is read(r),write(w) and execute(x).

3. Three character after that is indicates the permission for group (so based on the example above, group don't have a permission for this file)

4. The last three character is indicates the permission for other(except user that owned the file and their group), so based on the example there is no permissions for other.
  • How to change the permissions ?
NOTE : WE CAN ADD OR REMOVE THE PERMISSION FOR A FILE FOR SPECIFIC USER OR GROUP OR OTHER IF WE JUST LOG IN AS SUPER USER (ROOT)

1. Based on the example above, we would like to change the permissions for the group for read(r), and execute(x) the file. To change the permission we use 'chmod' command (change modifications). For example :

fresh-IDEA Downloads# chmod g+rx 93197-gotchione.tar.gz

So the result will be like that :

http://1.bp.blogspot.com/_4Qipqxw8DV.../s320/gbr2.png

2. The '+' character is used for add a permission for the file, but the '-' character is used for remove a permissions for the file. Form example we would like to remove the read(r) permission for the user that owned the file :

fresh-IDEA Downloads# chmod u-r 93197-gotchione.tar.gz

So the result will be like that :

http://4.bp.blogspot.com/_4Qipqxw8DV.../s320/gbr3.png

http://3.bp.blogspot.com/_4Qipqxw8DV.../s320/gbr4.png


اکنون ساعت 05:01 PM برپایه ساعت جهانی (GMT - گرینویچ) +3.5 می باشد.

Powered by vBulletin® Version 3.8.4 Copyright , Jelsoft Enterprices مدیریت توسط کورش نعلینی
استفاده از مطالب پی سی سیتی بدون ذکر منبع هم پیگرد قانونی ندارد!! (این دیگه به انصاف خودتونه !!)
(اگر مطلبی از شما در سایت ما بدون ذکر نامتان استفاده شده مارا خبر کنید تا آنرا اصلاح کنیم)