Skip to content
Advertisement

chmod: changing permissions of ‘my_script.sh’: Operation not permitted

when I’m trying to make shell script that error is shown ,what i must do ??

JavaScript

[sudo] password for rehamadel: [rehamadel@localhost bin]$ ls -l my_script.sh

JavaScript

Advertisement

Answer

Resolving the operation not permitted error:

JavaScript

You created the file via:

JavaScript

This means, the owner and group of the file is root. You are not allowed to change files of it by default. You need to change permission (chmod does it) or change the owner:

JavaScript

This should do it. Save the trouble, without creating the file via sudo.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement