Linux commands view and modify file properties

Source: Internet
Author: User

chmod

[ function Description ]

Change the access rights of a file

access in #Linux is divided into: File owner (the creator of the file) filegroup owner (the group where the creator is located) and others (other users)

[ syntax Format ]

chmod[ parameter ]mode[ file name or directory name ]

chmod[ parameter ]--referecnce= file name or directory name [ filename or directory name ]

[ option parameter ]

if the target file or directory is a symbolic link file, it changes the permissions of the symbol file itself, cannot change the point to the file, and the command does not want to provide the CHGRP command as a parameter to change the permissions of the symbol file, Only Superuser and file owners can change file access permissions

Mode is the specified permission, if set with a string, in the form [Ugoa ...] [+-=] [RWXX]. [..]

U represents the owner of the file

G represents a user who belongs to the same group as the file owner

O indicates another user

A means all users

+ indicates an increase in permissions - represents a cancel permission = represents a unique set of permissions

R = readable w means writable x means executable x Indicates that only if the file is a subdirectory or the directory has been set to perform

Parameters

Description

-C

Change information is displayed only if the file or directory permissions are changed

-V

Show details about permission changes

-F

If the file cannot change the permissions, the error message is not displayed

Chown

[ function Description ]

Change the owner or group of a file

# The owner of the file consists of the file owners and the group, the creator of the file defaults to the owners of the file, the group of files by default is the workgroup where the creator of the file, the owner of the user to create their own files have the most permissions, operation permissions can be comparable with the super user. A user can be in more than one group, so a file can also reside within multiple groups, and users within the same group have permission to share the file. In order to manage files effectively, it is important to change the owner and the group of files.

[ syntax Format ]

chown[ parameter ] belongs to the main / genus Group id[:[ Group user / group id]][ file name or directory name ]

[ option parameter ]

Parameters

Description

-C

Show only files that have changed successfully

-F

Exit without displaying an error

-H

If a symbolic link file is executed only on the symbolic link file, without affecting the file it points to, it is usually only useful for systems that allow the symbolic link file to change the group user

--deference

The Chown command defaults to the symbolic link file itself as the Master / Group user,--deference indicates that the symbolic link file points to the file to be manipulated instead of the symbolic link file itself

File

[ function Description ]

View File types

There is no extension in the #Linux, you can use the ls-l feature to view the types of files available

[ syntax Format ]

file[ Parameters ] [ file ]

[ option parameter ]

Parameters

Description

-B

The file name is not displayed when the identification results are listed

-C

Verbose display of command execution to facilitate troubleshooting or analysis of program execution

Just do a summary if it is wrong, please Daniel criticism advice.

Sincerely salute

Copyright notice

The contents of this summary are all excerpt from "Linux Command complete technical treasure" Zhang Dong

Linux commands view and modify file properties

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.