File Permission Learning

Source: Internet
Author: User
File Permission learning-general Linux technology-Linux technology and application information. The following is a detailed description. Ls-l list file information
Ls-al lists information including hidden files (beginning .)

Permissions: r (read 4), w (write 2), and x (execute 1)

Three types of permissions are assigned: file owner (u), group user (g), and other user (o)

Common file types include: d (directory),-(common file), and l (symbolic link)

However, when we use touch file to create a file or mkdir file to create a directory, we can see its default permission attribute through ls-l, which is actually the role of umask. The umask command determines the default mode for creating a file. You can modify the default value in the. profile or. bash_profile file in the $ HOME directory. If you want to modify all users, you can modify the value in/etc/profile. For files, the maximum umask value can be only 6 (that is, the execution permission is not granted by the row), and the maximum directory value can be 7.

Chmod instance
Chmod a-x file
Chomod og-w file
Chmod g + w file
Chmod-R 755 file

Chgrp instance
Chgrp file admin

Chown instance
Chown admin file

Create a soft link (similar to a windows shortcut)
Ln-s source_path target_path // absolute path

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.