-4

some_file.py:

#! /usr/bin/python
print("Hello World!")

On terminal:

sudo chown +x some_file.py
chown: invalid user: ‘+x’

I want to make the file executable.

Pushp Vashisht
  • 874
  • 3
  • 9
  • 17

1 Answers1

7

The chown command stands for change ownership. That's why you get invalid user: ‘+x’, because it was expecting a user as input.

If you want to change permissions of a file you must use the chmod command. To make a file executable for the user owner of that file you could try

chmod u+x some_file.py
Themelis
  • 4,048
  • 2
  • 21
  • 45