Search code examples
pythonlinuxshebang

chmod: cannot access ‘x’: No such file or directory


I was trying to follow this tutorial https://www.youtube.com/watch?v=fmqkncV6JIY. Basically I want to use shebang in my python code. I'm trying to run commands on AWS Linux instance. I got error while running

chmod + x ​ file.py

The error I got

chmod: cannot access ‘x’: No such file or directory


Solution

  • Remove the space between + and x:

    chmod +x ​file.py