in Linux to modify a folder or file permissions, we need to use Linux chmod command to do, I wrote a few simple example below you can consult.
chmod [who] [+ |-| =] [mode] filename
g stands for “group user”, that is, all users with the same group ID as the file owner.
o stands for other (others) users.
a stands for “all” users. It is the system default. The
action symbol can be:
+ to add a permission.
– cancel a permission.
= grant the given permission and cancel all other permissions, if any.
the permissions represented by the setting mode can be any combination of the following letters:
w can be written.
x executable. The
X attribute is appended only if the target file is executable for some users or if the target file is a directory.
s sets the process’s owner or group ID to the file’s owner at file execution time. Mode “U + S” to set the file user ID bit, “G +s” to set the group ID bit.
t saves the text of the program to the switching device.
u has the same permissions as the file owner.
g has the same permissions as the user in the same group as the file owner.
o has the same permissions as other users. Instance
modify attributes of the file read/write method, such as: the index. The HTML file is modified to write readable executable:
code below copy code chmod 777 index. HTML
directory to modify all write readable executable file attributes can be:
code below copy code chmod 777.
the folder name with the suffix to use * to instead of it.
such as: Modify the properties of all HTM files:
code copy code
chmod 777 *. HTM
method to modify folder properties
change directory /images/xiao to writable readable executable
code copy code
chmod 777 /images/xiao
modify all folder properties
code copy code
chmod 777 *
Just replace the folder name with *
to modify all files and folders in the folder and subfolder properties to be writable readable executable
code as follows copy code
chmod -r 777 /upload
summarizes the difference in permissions between directories and files under Linux.
files: read file contents (r), write data to file (w), execute file as command (x).
directory: read the files contained in the directory name (r), write information into the directory links (add and remove the index point), and search the directory (can use the directory name as a path name to access files and subdirectories) it contains specific said is:
(1) have read permissions users can’t use CD into the directory: also must have execute permission to enter.
(2) users with execute permission will only be able to access files in the directory if they know the file name and have read rights.
(3) you must have read and execute permissions to list directories ls, or use the CD command to enter directories.
(4) has write permissions to the directory and can create, delete, or modify any file or subdirectory under the directory, even if the file or subdirectory belongs to another user.
- Linux shell gets the file name under the folder
- Methods of modifying index and columns names by dataframe in pandas
- Delete files with specified suffix in specified folder under Linux
- The bash file written by windows runs in Linux system error
- Prompt when executing sh file in Linux: nohup: unable to run command “. / startup. Sh”: insufficient permissions
- Linux remote copy command and not a regular file solution
- Linux edit save file command
- Error:No toolchains found in the NDK toolchains folder for ABI with prefix: mipsel-linux-android
- Idea method of modifying git account and password
- Multi file decompression method GZ00 gz01 zip00 zip01 in windors Linux
- Solution to errors reported by TES command in vscode – errors reported by typescript command
- After modifying the Tomcat configuration file in development, the modified configuration file will be automatically restored after ecplise starts Tomcat
- Encapsulation of adding, deleting and modifying database by JDBC
- Two kinds of errors caused by root / lack of execution permission x
- Linux view folder size, remaining disk space (DU / DF)
- Error Ubuntu file permission not enough (RM)
- The command Du – h — max depth = 1 in Linux
- Solution: unable to delete folder (you need permission to perform this operation)
- Batch modification of file names on MAC Linux rename command line
- Bash modifies the file names in the specified folder through MAC terminal (batch modification)