How to remove execute permission?

QuestionsQuestions8 SkillsProHello, Bash!Oct, 09 2025
0157

To remove execute permission from a file in Unix-like operating systems, you can use the chmod command with the -x option. Here’s the syntax:

chmod -x filename

For example, to remove execute permission from a file named hello.sh, you would run:

chmod -x hello.sh

This command will remove the execute permission for the user, group, and others. If you want to specify which category to remove execute permission from (user, group, or others), you can use:

  • u: user (owner)
  • g: group
  • o: others

For example, to remove execute permission only for the user, you would use:

chmod u-x hello.sh

Let me know if you need more help!

0 Comments

no data
Be the first to share your comment!