Colleagues often ask, when deleting files/directories, an Operation not permitted error is reported. How to deal with this? ! This is usually a permissions issue, such as: 1. If you are a normal user with sufficient permissions, the folder may be used by other services/processes.
First execute the above command to query the process IDs that call the folder, and then kill it. At this time, it should be possible to delete it! 2. If you are a normal user and lack permissions, you need to use the su or sudo command to delete the folder 3. If you are the root user and still get the above error, the file is likely locked [root@linux ~]# lsattr YourFile ---i---------- YourFile You need to use the lsattr command to check whether the system has added i, attributes, such as above. This parameter makes a file "cannot be deleted, renamed, set links, or have data written or added! It is of great help to system security! This command is also the reason why you cannot perform the deletion operation even if you are the root user. Then use the chattr command to remove the attribute [root@linux ~]# chattr -i YourFile [root@linux ~]# lsattr YourFile [root@linux ~]# Then you can delete the file! Note: The i attribute of the chattr command is not suitable for all directories. The chattr command cannot protect the /, /dev, /tmp, and /var directories. Think about it: for example, in the /tmp directory, all users can create and delete their own temporary files, and the same is true for the root user. What will happen if even the root user cannot delete the files in this directory? Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: mysql5.7 installation and configuration tutorial under Centos7.3
>>: React Fiber structure creation steps
Before configuration, we need to do the following...
theme Today I will teach you how to create a circ...
Table of contents JavaScript function call classi...
Put your own web project in the webapps directory...
Table of contents 1. Preliminary preparation 1.1 ...
Description: Change the carriage return in the tex...
Table of contents 1. Scopes are expressed in diff...
1. Do a good job of cleaning before installation ...
This article example shares the specific code of ...
What is high concurrency? The default Linux kerne...
Simple use of Vue bus Scenario description: Compo...
The configuration method of MySQL 5.5.56 free ins...
Deploy nginx with docker, it's so simple Just...
1. MacVlan There are many solutions to achieve cr...
In Black Duck's 2017 open source survey, 77% ...