Linux File Permissions Assignment

Source: Internet
Author: User
Tags readable

1 Modify Permissions
command: chmod (change mode)
function: Change the file read and write and execute permissions. Signed method and octal number method.
option: (1) Symbol method:
command format: chmod {u|g|o|a}{+|-|=}{r|w|x} filename
u (user) indicates the users themselves.
g (group) represents the same group of users.
O (oher) represents another user.
A (All) represents all users.
+ used to give permission to the specified user.
-Used to cancel the permissions of the specified user.
= Assign the permission to the file.
R (Read) Read permission, which means that the contents of the file or directory can be copied.
W (write) writes a permission that indicates that the contents of the file or directory can be modified.
x (execute) Executes the license, indicating that the file can be executed or entered into the directory.
  
(2) Octal number method:
command format: chmod ABC file
Each of the a,b,c is an octal number, which represents the permissions of user, Group, and other respectively.
4 (100) indicates readable.
2 (010) indicates writable.
1 (001) indicates executable.
to rwx the attribute then 4+2+1=7;
to rw-the attribute then 4+2=6;
to r-x the property, 4+1=5.

Example: # chmod a+rx filename
allows all users to read and execute file filename.
# chmod GO-RX filename
cancels the permissions of the same group and other users to read and execute file filename.
# chmod 741 filename
allow me to read and write execution, the same group of user-readable, other user executable file filename.
# chmod-r 755/home/oracle
recursive change of directory permissions, I can read and write execution, the same group of user-readable executable, other user-readable executable

Linux File Permissions Assignment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.