10 Kasım 2015 Salı

What Do Permissions Mean for Both Files and Directories on The Systems Unix Based.

In the system Linux based, sometimes permissions of the files and directories might be confusing .  Whereas when it comes to files, meanings of the operations which are  divided into three main groups is very clear. If you have reading permission, you can read the file; if you have a write permisson, you can write into the file and if you have execution permisson, you can execute the file as a program.
However you know that the same permissons mode (read, write, execute) also are used for directories. Then what do they mean?
If you have one of the rights below, what you can do with it is that:

Read: If you have reading permission on a directory, you can list content of the directory.
Let us try:

$ mkdir example_dir
$ chmod a= example_dir
$ ls example_dir
>ls: cannot open directory abc: Permission denied
$ ls a=r example_dir
$ ls  example_dir
> contents of the example_dir directory

Write: Thanks to writing permisson, you can rename the files in the directory, you can modify the files in the directory or even you can delete the file or create a new one in the directory.

Execute :  You may be amazed, by this permission, you can execute the cd (change directory) command and change your present directory to the directory on which you have execute permission.

$ cd example_dir
>bash: cd: abc: Permission denied
$ chmod a=x example_dir
$ cd example_dir

Hiç yorum yok: