:
chmod
UGOA
+ (Join)-(remove)= (set)
RWX
File or directory
If we need to set the file permissions to -rwxr-xr-- , you can use the chmod u=rwx,g=rx,o=r file name to set:[Email protected]:/home/test/tt$ chmod u=rwx,g=rwx,o=-M.c[email protected]-sys:/home/test/tt$ LS-L Total Dosage4-RWXRWX---1DAOKR Root -March - -: $M.c[email protected]-sys:/home/test/tt$ chmod u=r-x,g=-wx,o=-M.c[email protected]-sys:/home/test/tt$ LS-L Total Dosage4-R--------1DAOKR
The liunx command chown is used to change the owner of a specified file to the specified user or group chown. the user can be a user name or user ID; A group can be a group name or group ID. Files are separated by spaces to change the permission list. Wildcards are supported. The system administrator often uses the chown
Chmod is the right to change a file Chown is the owner and genus of the modified file Chgrp only the genus group that changed the file.(1) chmod is the right to modify the file/directory. can have text modification and digital modification.#chmod 777/home/berry#chmod U+x/home/berryAction object who is either or a combination of the following letters:
U means "user", which is the owner of the file or directory.
G means "same group user"
ChownIs a command used to set file owners and file associations in UNIX systems. Super User Permissions are required to execute this command. Only the file owner of the file group and the super user can change the file association group. If you do not have permissions, you may need to use the chgrp command to set the association group.Usage
#
Linux, you can use the Chown command to modify the folder's user rights.
1. Log in to Linux with normal user A, and use Su-to switch to the root user
2. Under root user, you can see the contents of the folder
3. But unable to open git folder through file system
Prompt cannot display remote folder (should be insufficient permissions)
This is
This command can unlock the Linux file's super-privilege limitExtract:Chown the owner of the specified file to the specified user or group, the user can be either a user name or a user ID; a group can be a group name or a group ID; a file is a space-separated list of files to change permissions, and wildcard characters are supported. System administrators often use the Chown
readable by anyone:Chmod-r A+r *In addition chmod can also use numbers to represent permissions such as chmod 777 fileThe syntax is: chmod ABC fileEach of the a,b,c is a number that represents the permissions of the user, Group, and other respectively.R=4,w=2,x=1To rwx the attribute then 4+2+1=7;To rw-the attribute then 4+2=6;To r-x the property, 4+1=7.Example 2:chmod a=rwx FileAndchmod 777 FileSame effectchmod ug=rwx,o=x FileAndchmod 771 FileSame effectUsing chmod 4755 filename allows this pro
+1=5; Example 01Command: chmod 777 TestFile.txtInput: [[email protected] root]# chmod 777 TestFile.txtDescriptionChange the Read and write execution permissions of TestFile.txt, all users of this machine can do all the work on this file.015Linux chown Command1 command formatchown [Options] [owner] format chown[option] [user]2
These three commands are changed file attributes and permissions, put together to writeCharp: Changing the user group to which the file belongsChown: Change the file ownerchmod: Changing the permissions of a fileA file for Owner,group, others have different permissions, chmod is used to change the permissions, each identity has three permissions, respectively, is r,w,xThe score for each permission is R:4 w:2 x:1, which can be summed, for example, when the permission is rwx 7So the simplest way t
consistent with the file, and finally change the permissions of test to default, execute Chmod–r g-w test3. Change the file owner: chown CommandBasic usage chown owner: Owning group file name, or Chown–r owner: owning Group directory nameFor example, to modify the file Test.txt the owner of the User1 is used: Chown us
Chown the owner of the specified file to the specified user or group, the user can be either a user name or a user ID; a group can be a group name or a group ID; a file is a space-separated list of files to change permissions, and wildcard characters are supported. System administrators often use the Chown command to give users permission to use a file after copy
Chown the owner of the specified file to the specified user or group, the user can be either a user name or a user ID; a group can be a group name or a group ID; a file is a space-separated list of files to change permissions, and wildcard characters are supported. System administrators often use the Chown command to give users permission to use a file after copy
if it already has execute permissions
2. s is used to set the UID or GID that is being executed
3. t for saving program text
4. U is used to set permissions to the owner's permissions
5. g is used to set permissions to the user group's permissions
6. o is used to set permissions to other people's permissions
The operation instance of the command is as follows:
The chmod-r parameter loops through file and directory modifications. You can use wildcard
'/' specially (the default)--presErve-root fail to operate recursively on '/'-F,--silent,--quiet suppress most error messages--reference=rfil E use Rfile ' s owner and group rather than specifying Owner:group values-r,--recursive o Perate on files and directories recursively-v,--verbose output a diagnostic for every file processedthe follow ing options Modify how a hierarchy are traversed when the-roption is also specified. If more than one are specified, only the finalone takes effect. -H i
Command format:chown [option] Owner: A group file or directory (option is not writable)
Command function:Change the attribution of a file or directory
Common options:- R recursively modifies directory attribution- H Modifying the attribution of symbolic links- v show verbose process
Common examples:Example one: Change the owner and host group of file files to Zhangsan, which is currently the root user
First, Chown commandPurpose: Change the owner or group of the file. The command is composed of the word change owner.Examples of Use:1. Change the owner of the file:Chown Jim Program.cChange the owner of the file program.c to Jim. As an owner, Jim can use the chmod command to allow or deny other users access to PROGRAM.C.2. Change the owner of the directory:Chown
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.