In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use the Linux command chmod. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
# # the chmod command is used to change the access permissions of files on the Linux system. It is usually used to control access to files, to make files writable or to allow access to only certain users.
# # File permissions in Linux system in Linux system, everything is a file. Every file in the Linux system has access permission, which is used to determine which access methods can be used by various users to access and manipulate the files. There are three types of access to files: read-only and write-only and executable.
Read-only permission means that only its contents are allowed to be read, and no other operations are allowed on it. Executable permission representation
Executable means that the file is allowed to be executed as a program
Writable permission means that the file can be written (modified or added).
# different types of file users > owner file owners > group users in the same group > other other users
There are three sets of access permissions for each file. Each group is represented by three digits, which are the read, write and execute permissions of the file owner, the read, write and execute permissions of the users in the same group as the file owner, and the read, write and execute permissions of other users in the system. If you need to view the details of file permissions, you can use the ls-l command. For example:
After determining the access permissions for a file, you can use the chmod command provided by the Linux system to reset different access permissions for the file.
# Command format
Chmod [- cfvR] [--help] [--version] mode file
# Parameter description > *-c when a change occurs, report processing information > *-f error message does not output > *-R processes all files in the specified directory and its subdirectories > *-v displays detailed processing information at runtime
# scope code u: current user of directory or file g: current group of directory or file o: user or group other than the current user or group of directory or file a: all users and groups
# permission code: r: read permission, with the number 4 for w: write permission, with the number 2 for x: execute permission, with the number 1 for delete permission, with the number 0 for s: special permission
# # chmod Command usage this command can be used in two ways
# # text setting > use letter and operator expressions. Such as
Chmod aquix phptest.log # adds permissions to all users to execute this file
# the meaning of numeric attributes: 0 indicates no permission, 1 indicates executable permission, 2 indicates writable permission, 4 indicates readable permission, and then adds it. The number attribute is the octal number of 3 songs 0-7, and the corresponding users are u, g, o.
Use numbers to change the permissions of files or directories. Such as
Chmod 777 phptest.log # makes the file readable, writable and executable for all users
# # use instance # instance 1: increase the executable permissions of all user groups in the file
Chmod axix tmp.log
# instance 2: modify different user permissions at the same time
Chmod ug+w,o-x log2015.log
# instance 3: delete file permissions
Chmod Amurx log2015.log
Thank you for reading! This is the end of the article on "how to use Linux Command chmod". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.