File Access Permission

[root@fedora12 user1]# chmod 777 file1
[root@fedora12 user1]# ls -l file1
-rwxrwxrwx 1 user1 user1 0 2009-12-22 15:31 file1
[root@fedora12 user1]# chmod ugo+x file1
[root@fedora12 user1]# ls -l file1
-rwxrwxrwx 1 user1 user1 0 2009-12-22 15:31 file1
[root@fedora12 user1]# chmod 000 file1
[root@fedora12 user1]# ls -l file1
———- 1 user1 user1 0 2009-12-22 15:31 file1
[root@fedora12 user1]# chmod +x file1
[root@fedora12 user1]# ls -l file1
—x–x–x 1 user1 user1 0 2009-12-22 15:31 file1
[root@fedora12 user1]# chmod +r file1
[root@fedora12 user1]# ls -l file1
-r-xr-xr-x 1 user1 user1 0 2009-12-22 15:31 file1
[root@fedora12 user1]# chmod +w -r file1
chmod: cannot access `+w’: No such file or directory
[root@fedora12 user1]# chmod -r file1
[root@fedora12 user1]# ls -l file1
—x–x–x 1 user1 user1 0 2009-12-22 15:31 file1
[root@fedora12 user1]#

Permissions are intended to 3

1.Owner

2.Group

3.others

for three of them 3 permissions are there

r=Read

w=Write

x=Execute

and Hence rwx rwx rwx

=

000 000 000 => for No permission

and

111 111 111 =>for Full Permission

and rest values accordingly

Eg. To add all permissions to file1

[root@fedora12 user1]# chmod 777 file1

[root@fedora12 user1]# ls -l file1

-rwxrwxrwx 1 user1 user1 0 2009-12-22 15:31 file1

Alternatively this method can be used , here user, Group,Others will be added with Read Permissions

[root@fedora12 user1]# chmod ugo+x file1

[root@fedora12 user1]# ls -l file1

-rwxrwxrwx 1 user1 user1 0 2009-12-22 15:31 file1

–Reseting

[root@fedora12 user1]# chmod 000 file1

[root@fedora12 user1]# ls -l file1

———- 1 user1 user1 0 2009-12-22 15:31 file1

Another way is to use+x,+r,+w to add corresponding Permissions to All

[root@fedora12 user1]# chmod +x file1

[root@fedora12 user1]# ls -l file1

—x–x–x 1 user1 user1 0 2009-12-22 15:31 file1

[root@fedora12 user1]# chmod +r file1

[root@fedora12 user1]# ls -l file1

-r-xr-xr-x 1 user1 user1 0 2009-12-22 15:31 file1

[root@fedora12 user1]# chmod +w -r file1

chmod: cannot access `+w’: No such file or directory

[root@fedora12 user1]# chmod -r file1

[root@fedora12 user1]# ls -l file1

—x–x–x 1 user1 user1 0 2009-12-22 15:31 file1

[root@fedora12 user1]#

  • Meet Author

    S.Abhilash, started this blog in the later half of 2009 as a self hosting site for all his previous blogging attempts. , My way of writing and frequency of publishing may not be uniform as my resources are my projects nd issues i came across. For the last few years this blog is reacing 100 s of unique visitors each day, thanks wordpress and google for such a perfection in their software and services.

    Head to Authors Page | Abhilash on Facebook



Category Linux Shell     Tags , , , , , , , ,

Comment on Facebook

1 Comment to “File Access Permission”

Community



FREE News Letter

Enter your email address

See Also

  • How to Hide friendlist from friends in facebook

    Step 1 Login to your facebook account. Step 2 Choose Privacy Settings under Account. Step 3 You can see an [...]

    (No Comments)

  • New Features in IE 9

    New Interface Searching in the address Bar We can search directly from the address bar.If we enter anything in the [...]

    (1 Comment)

  • Visual Basic For Linux

    Visual basic is the most friendly GUI development tool ever released,and its released under Windows. i googled for years to [...]

    (1 Comment)

Resources

Please Submit your Email Address to Get Latest Technology News As it Happens


Enter your email address


Read previous post:
Change Ownership Of Files

[user1@fedora12 ~]$ su Password: [root@fedora12 user1]# touch file1 [root@fedora12 user1]# chown user1 file1 [root@fedora12 user1]# ls -l file1 -rw-r--r-- 1...

Close