


Linux file permissions Speaking of permissions, Linux file calling permissions are divided into three types of permissions
1. Linux file permissions
Speaking of permissions, Linux file calling permissions are divided into three types of permissions for all objects: user, group user's group, and other people. Each object has three permissions: r: read, w: write, x: execute. Madmen like to use numbers to represent them, such as: rwx is the two's complement 111, which is the ten's complement 7. For example, we view the information of all files in the current directory ls-l:
1. The first digit in circle 1 indicates the type of the file, - indicates an ordinary file, d indicates a directory, and l indicates a link; the next nine digits can be divided into three groups of rwx, each group corresponding to all objects with each permission, This means that user has rwx read, write and execute permissions, group has r-x read and execute permissions, and other has r-x read and execute permissions
2. The ten’s complement number 3 means it has been cited three times
3. The first root indicates that the file owner is the super administrator root, and the second indicates that the group it belongs to is the root group
4. File size (unit: Byte), if you want to display kb or Mb units, ls-lh
5.The last time this file was changed
6.File name
2. umask and chmod
1.umask: Determine the permissions when the file is built. For newly created files, the system does not allow it to have execution permissions when it is complete, that is, the maximum permissions are 666 (rw-rw-rw-); for newly created directories, the maximum permissions are 777 (rwxrwxrwx)
1.umask: Determine the permissions when the file is built. For newly created files, the system does not allow it to have execution permissions when it is complete linux permissions to view files, that is, the maximum permissions are 666 (rw-rw-rw-); for newly created directories Say, the maximum permission is 777 (rwxrwxrwx)
I want to check the default permissions of the currently created files: umask, what I see here is 0022 [the first 0 represents special permissions regardless of him] linux View file permissions , the permissions of the created file are 666 -022=644 is rw-r–r--, and the permissions of the created directory are 777-022=755 which is rwxr-xr-x. (Note: Since creating files does not allow x permissions, the position of the three-digit ten's complement prime number obtained after estimating the umask must be added by 1. For example, setting the umask to 031 command: umask0031, the permissions of the created file are 666-031=635, 635 +011=646i.e. rw-r–rw-)
umask0031Create directory permissions are 777-031=746 which is rwxr–rw-
[Note] This can only temporarily modify the umask value. Linux common commands. If you want to make permanent changes, you need to modify the configuration file. If you are crazy, don’t do it yourself. Baidu
2.chmod: Modify the permissions of existing files. For example, when a was created just now, the permissions were 644. After executing the command: chmod777a and later the linux format command, the permissions of a were changed to 777, which is rwxrwxrwx
The above is the detailed content of Linux file permissions Speaking of permissions, Linux file calling permissions are divided into three types of permissions. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The Linux command line interface provides a wealth of text processing tools, one of the most powerful tools is the sed command. sed is the abbreviation of Stream EDitor, a multi-functional tool that allows complex processing of text files and streams. What is Sed? sed is a non-interactive text editor that operates on pipeline inputs or text files. By providing directives, you can let it modify and process text in a file or stream. The most common use cases of sed include selecting text, replacing text, modifying original files, adding lines to text, or removing lines from text. It can be used from the command line in Bash and other command line shells. Sed command syntax sed

Efficiently Counting Files and Folders in Linux: A Comprehensive Guide Knowing how to quickly count files and directories in Linux is crucial for system administrators and anyone managing large datasets. This guide demonstrates using simple command-l

Discover Pilet: A Retro-Futuristic, Open-Source Mini-Computer Looking for a mini-computer that blends classic style with cutting-edge technology? Meet Pilet, a modular, open-source marvel powered by the Raspberry Pi 5. Boasting a 7-hour battery life

Efficiently managing user accounts and group memberships is crucial for Linux/Unix system administration. This ensures proper resource and data access control. This tutorial details how to add a user to multiple groups in Linux and Unix systems. We

Liquorix kernel: a powerful tool to improve Linux system performance Linux is known for its flexibility, security and high performance, becoming the operating system of choice for developers, system administrators, and advanced users. However, the universal Linux kernel is not always meeting the needs of users seeking maximum performance and responsiveness. This is where the Liquorix kernel comes into play—a performance-optimized alternative that promises to enhance your Linux system. This article will explore what the Liquorix kernel is, why you might want to use it, and how to install and configure it to get the most out of your system. Liquorix kernel detailed explanation Liquorix kernel is a precompiled Linux kernel designed for

Linux Kernel is the core component of a GNU/Linux operating system. Developed by Linus Torvalds in 1991, it is a free, open-source, monolithic, modular, and multitasking Unix-like kernel. In Linux, it is possible to install multiple kernels on a sing

Keep your computer awake effortlessly with Keep-Alive! This lightweight tool prevents your system from sleeping, ideal for long downloads, continuous processes, or simply maintaining system activity. Compatible with Linux, macOS, and Windows, Keep-

This brief guide explains how to type Indian Rupee symbol in Linux operating systems. The other day, I wanted to type "Indian Rupee Symbol (₹)" in a word document. My keyboard has a rupee symbol on it, but I don't know how to type it. After
